-
Notifications
You must be signed in to change notification settings - Fork 7k
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
assume that integer images are [0, 255] in equalize #6859
Conversation
output_dtype = image.dtype | ||
image = convert_dtype_image_tensor(image, torch.uint8) | ||
if image.is_floating_point(): |
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.
We don't need to do anything for the other integers here since we assume they are already in the range [0, 255]
and thus no conversion is needed.
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!
Reviewed By: datumbox Differential Revision: D40851027 fbshipit-source-id: c3e55e63bd176e3e88501139a1a0400304a477f8
* fix prototype kernels * fix stable kernels * fix tests * make test more robust * improve invert for signed integers * improve invert * fix posterize * Revert "assume that integer images are [0, 255] in equalize (#6859)" This reverts commit 436ff9a. * fix solarize in AA * fix resize * Revert "fix resize" This reverts commit 5f33f4a. * add comment to float max value Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Summary: * fix prototype kernels * fix stable kernels * fix tests * make test more robust * improve invert for signed integers * improve invert * fix posterize * Revert "assume that integer images are [0, 255] in equalize (#6859)" This reverts commit 436ff9a. * fix solarize in AA * fix resize * Revert "fix resize" This reverts commit 5f33f4a. * add comment to float max value Reviewed By: datumbox Differential Revision: D41020539 fbshipit-source-id: 1c618ead36a0ae4d93b4ebf07186fd39bd85d915 Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Same as #6847 (comment), but as a follow-up to #6851.
cc @vfdev-5 @datumbox @bjuncek