Skip to content

Some questions about Image Normalization #255

New issue

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

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

Already on GitHub? # to your account

Closed
makecent opened this issue Oct 15, 2020 · 4 comments · Fixed by #273
Closed

Some questions about Image Normalization #255

makecent opened this issue Oct 15, 2020 · 4 comments · Fixed by #273
Assignees

Comments

@makecent
Copy link
Contributor

I found "img_norm_cfg" in "tsn_r50_1x1x3_80e_ucf101_rgb.py" and "tsn_r50_1x1x3_100e_kinetics400_rgb.py" are different with each other. They are "mean=[104, 117, 128], std=[1, 1, 1]" and "mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375]" respectively.
While both of them use resnet50 as the backbone and use pre-trained weights from torchvision. Why use different norm_cfg and how should I determine it?

I also notice that the second img_norm_cfg is equal to the normalization configurations mentioned in torchvison website divided by 255. But I cannot find any pipeline did this operation, i.e. (/255). I cannot found this in Normalize, neither in ToTensor. And when I print the range of image values after ToTensor pipeline, it seems there are lots of images are not in range of (0, 1).

@innerlee
Copy link
Contributor

Thanks for the report. You are right, this line https://github.com/open-mmlab/mmaction2/blob/master/configs/recognition/tsn/tsn_r50_1x1x3_80e_ucf101_rgb.py#L28 looks strange. Please change it to the other value

@innerlee
Copy link
Contributor

innerlee commented Oct 16, 2020

Confirmed with @dreamerlin , this config is modified from mmaction's tsn+bninception https://github.com/open-mmlab/mmaction/blob/master/configs/TSN/ucf101/tsn_rgb_bninception.py#L31 , which originates from the original tsn https://github.com/yjxiong/temporal-segment-networks/blob/2c5e5e7c9c4f552cfde46fa90a4c0c230d857afe/pyActionRecog/action_caffe.py#L27

So the original one does not scale, and the mean values are a little bit different from pytorch's.

We plan to update the normalize cfg to new ones, and release a new checkpoint

@makecent
Copy link
Contributor Author

Confirmed with @dreamerlin , this config is modified from mmaction's tsn+bninception https://github.com/open-mmlab/mmaction/blob/master/configs/TSN/ucf101/tsn_rgb_bninception.py#L31 , which originates from the original tsn https://github.com/yjxiong/temporal-segment-networks/blob/2c5e5e7c9c4f552cfde46fa90a4c0c230d857afe/pyActionRecog/action_caffe.py#L27

So the original one does not scale, and the mean values are a little bit different from pytorch's.

We plan to update the normalize cfg to new ones, and release a new checkpoint

Thanks.

@dreamerlin
Copy link
Collaborator

We may add a new config for TSN-UCF101

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

Successfully merging a pull request may close this issue.

4 participants