Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image preprocessing #13

Open
seann999 opened this issue Dec 2, 2017 · 9 comments
Open

Image preprocessing #13

seann999 opened this issue Dec 2, 2017 · 9 comments

Comments

@seann999
Copy link

seann999 commented Dec 2, 2017

The readme says to scale the RGB values between -1 and 1. Does this mean x/128.0-1.0, where x is an uint8 image?
I'm more used to seeing normalizing images with mean and std, so I want to make sure.

@zekun-li
Copy link

zekun-li commented Mar 1, 2018

I have the same question. However when I do x/128. - 1. on the sample data, the result doesn't match with the given .npy

@egg347
Copy link

egg347 commented May 14, 2018

@zekun-li Hi, the provided *.npy file has shape (1, num_frames, 224, 224, 3), I wonder what "1" refers to? And what's its value?

@zekun-li
Copy link

@egg347 That dimension corresponds to batch size.

@egg347
Copy link

egg347 commented May 19, 2018

@zekun-li Thanks a lot! Have you solved your problem above? It seems that the sample data firstly rescale to [-1,1](videos to videos),and secondly rescale to [0,1](videos to *.npy file).
By the way, I'm confused about the output of the sample. According to the "evalutate_sample.py", it prints Norm of logits、out_predictions[index]、out_logits[index]、kinetics_classes[index])。So what Norm of logits and out_logits[index] can be used for?
With no offense, are you Chinese? Your id looks like a Chinese name. Would you please leave me your EMAIL or your WECHAT id if you don't mind? It comforts me to communicate in Chinese.

@TianjiPang
Copy link

@zekun-li I also have the same problem on preprocessing. No matter rescaling the image on R, G, B channel individually or across RGB channals, the results all can't match with the given .npy. Have you solved the problem?

@vivoutlaw
Copy link

@zekun-li @egg347 @TianjiPang @seann999 : Hi guys, were you able to resolve the scaling. If yes, would you mind sharing what you did. Thanks

@seann999
Copy link
Author

I think I simply did what I first guessed, x/128.0-1.0.

@vivoutlaw
Copy link

@seann999: I did the same too, I hope the extracted feature are alright.

@bryanyzhu
Copy link

@zekun-li @seann999 @vivoutlaw @TianjiPang @egg347 I saw many people use x/128.0-1.0 as image normalization. But I still have doubts . For example, if I apply this kind of preprocessing to my frames extracted from v_CricketShot_g04_c01.mp4, the prediction result I get is robot dancing. I tried many videos, none of the prediction is correct.

So when you say your result doesn't match with the given .npy, do you mean the prediction is totally wrong (as in my case), or the prediction is correct (just the softmax score distribution is different)? Thank you very much. Looking forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants