facebookresearch / facebookresearch/fvcore

Clipping only applied to image arrays that arrive in uint8 type

Open
#110 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.3k
Forks
236
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/4364299/170241612-df1f8a31-1eb7-4aa1-b59c-29d9cbfd5e54.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.