facebookresearch / fvcore

Collection of common code that's shared among different research projects in FAIR computer vision team.
Apache License 2.0
2k stars 226 forks source link

Clipping only applied to image arrays that arrive in uint8 type #110

Open Trolomoll opened 2 years ago

Trolomoll commented 2 years ago

https://github.com/facebookresearch/fvcore/blob/8cf4acc89e765b263e2afd8a5bcefa8fd677c5f3/fvcore/transforms/transform.py#L849

The apply_image function of BlendTransform only applies clipping pixel values between [0 ,255] after blending to image arrays that arrive in type uint8. Clipping should also be applied to image arrays that already arrive in type float32, otherwise, we potentially feed a model with images like this (After increasing the brightness by a factor of ~1.3, on an image already in type float32):

image