toandaominh1997 / EfficientDet.Pytorch

Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch
MIT License
1.44k stars 305 forks source link

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

Open lampsonSong opened 4 years ago

lampsonSong commented 4 years ago

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 commented 4 years ago

I think the problem is only for COCO.

lampsonSong commented 4 years ago

I think the problem is only for COCO.

Yes, for coco.