Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants