Skip to content

Fix functional.adjust_gamma #5427

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

Merged
merged 2 commits into from
Feb 16, 2022
Merged

Conversation

malfet
Copy link
Contributor

@malfet malfet commented Feb 16, 2022

Discovered while trying to enable CI on python-3.10

Apparently array passed to Image.point should be array of integers for "RGB" image mode

@facebook-github-bot
Copy link

facebook-github-bot commented Feb 16, 2022

💊 CI failures summary and remediations

As of commit 9f0cb0a (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@pmeier
Copy link
Collaborator

pmeier commented Feb 16, 2022

@malfet Are you sure this is the case?

import PIL.Image

gamma = 1.0
gain = 1.0

img = PIL.Image.open("test/assets/encode_jpeg/grace_hopper_517x606.jpg")

img = img.convert("RGB")
gamma_map = [(255 + 1 - 1e-3) * gain * pow(ele / 255.0, gamma) for ele in range(256)] * 3
img = img.point(gamma_map)

works out fine for me. I don't see anything that should change just from using Python 3.10. Could you point me to a CI run where the error is happening?

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.

@malfet Thanks! I think you can have an awesome career in signal processing 😄

@pmeier See this test. It's possibly depended on the version of PIL you use.

@datumbox datumbox merged commit 8bf46d4 into main Feb 16, 2022
@datumbox datumbox deleted the malfet/fix-functional-adjust-gamma branch February 16, 2022 08:40
@malfet
Copy link
Contributor Author

malfet commented Feb 16, 2022

@datumbox thank you! All my years at Oculus finally starting to pay off :)

jdsgomes pushed a commit to jdsgomes/vision that referenced this pull request Feb 16, 2022
datumbox pushed a commit that referenced this pull request Feb 16, 2022
facebook-github-bot pushed a commit that referenced this pull request Feb 25, 2022
Reviewed By: jdsgomes

Differential Revision: D34475324

fbshipit-source-id: cbee37b84d6454aca4a98c559f20fb2c2a565175
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.

4 participants