Skip to content
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

Merged
merged 2 commits into from
Oct 28, 2022

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Oct 28, 2022

Same as #6847 (comment), but as a follow-up to #6851.

cc @vfdev-5 @datumbox @bjuncek

output_dtype = image.dtype
image = convert_dtype_image_tensor(image, torch.uint8)
if image.is_floating_point():
Copy link
Collaborator Author

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.

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@pmeier pmeier merged commit 436ff9a into pytorch:main Oct 28, 2022
@pmeier pmeier deleted the equalize-255 branch October 28, 2022 11:48
pmeier added a commit to pmeier/vision that referenced this pull request Oct 28, 2022
facebook-github-bot pushed a commit that referenced this pull request Oct 31, 2022
Reviewed By: datumbox

Differential Revision: D40851027

fbshipit-source-id: c3e55e63bd176e3e88501139a1a0400304a477f8
pmeier added a commit that referenced this pull request Nov 3, 2022
* 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>
facebook-github-bot pushed a commit that referenced this pull request Nov 4, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants