-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Fix bug on autocontrast when min==max
#4999
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
Fix bug on autocontrast when min==max
#4999
Conversation
💊 CI failures summary and remediationsAs of commit f00737a (more details on the Dr. CI page):
2 failures not recognized by patterns:
1 job timed out:
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Thanks for your response, but this fix doesn't seem to be correct? You are replacing NAN with 1.0, which is not expected. Constant across channel should still keep the value after autocontrast, rather than replacing them to 1.0. Am I understanding autocontrast correctly? |
421f593
to
367deb2
Compare
367deb2
to
cb7d27a
Compare
Just to confirm, current fix seems to implement (channel-wise) normalization as I illustrated in #4995 (comment). Is this expected? Or shall we use (image-wise)? I'm not sure which behavior is we expect... Not quite familiar with this operation. |
2ab06ac
to
35de04c
Compare
@ain-soph I believe the correct is to do channel-wise. I've added one more test that shows/confirms this. Below we are comparing the output of PIL vs TorchVision implementation for an image that has constant values across channels: vision/test/test_transforms.py Lines 576 to 582 in 35de04c
|
That sounds nice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Fixes issue reported by @ain-soph at #4995 (comment)
cc @vfdev-5 @datumbox