Skip to content

Conversation

EIFY
Copy link
Contributor

@EIFY EIFY commented Nov 28, 2024

See google-research/big_vision#109, fix suggested by @yeqingli in tensorflow/models#11219 (review).

In short, the original implementation of the contrast() transform which is copied 4-5+ times is broken:
What is meant to be the mean RGB value ends up being (h*w) / 256, which is always 196 for 224x224 crop.
This bug is often left unfixed, but here we are comparing the JAX vs. PyTorch implementations and the latter has the correct contrast transform:

elif op_name == 'Contrast':
img = F.adjust_contrast(img, magnitude)

So the JAX counterpart should be correct as well.

@EIFY EIFY requested a review from a team as a code owner November 28, 2024 22:33
Copy link

github-actions bot commented Nov 28, 2024

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@priyakasimbeg priyakasimbeg changed the base branch from main to dev April 1, 2025 16:43
priyakasimbeg
priyakasimbeg previously approved these changes Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants