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

Normalization problem: img is in [0,255] but mean and std are in [0,1] #137

Open
lampsonSong opened this issue Mar 27, 2020 · 2 comments
Open

Comments

@lampsonSong
Copy link

There is a bug in the dataset/augmentation.py , Normalizer():

the img here is range from 0 to 255, but the mean and std used here are range from 0 to 1.

The code :

return {'img': ((image.astype(np.float32) - self.mean) / self.std), 'annot': annots}

should be changed to :

return {'img': ((image.astype(np.float32) / 255. - self.mean) / self.std), 'annot': annots}

@ggaziv
Copy link

ggaziv commented Apr 6, 2020

I think the problem is only for COCO.

@lampsonSong
Copy link
Author

I think the problem is only for COCO.

Yes, for coco.

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

2 participants