Skip to content

Conversation

@justincdavis
Copy link

@justincdavis justincdavis commented Dec 2, 2025

Summary

Implements the adjust_brightness, adjust_contrast, adjust_hue, and 'adjust_saturation' CV-CUDA kernels

Testing

python3 -m pytest test/test_transforms_v2.py::TestAdjustBrightness
python3 -m pytest test/test_transforms_v2.py::TestAdjustContrast
python3 -m pytest test/test_transforms_v2.py::TestAdjustHue
python3 -m pytest test/test_transforms_v2.py::TestAdjustSaturation
python3 -m pytest test/test_transforms_v2.py::TestColorJitter

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 2, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9297

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 4 New Failures, 1 Unrelated Failure

As of commit 13f6e7c with merge base aa35ca1 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the cla signed label Dec 2, 2025
@justincdavis justincdavis changed the title Brightness contrast hue cvcuda AdjustBrightness/Contrast/Hue CV-CUDA Backend Dec 2, 2025
@justincdavis justincdavis changed the title AdjustBrightness/Contrast/Hue CV-CUDA Backend AdjustBrightness/Contrast/Hue/Saturation CV-CUDA Backend Dec 2, 2025
@justincdavis justincdavis force-pushed the brightness_contrast_hue_cvcuda branch from efef692 to 8564f0a Compare December 4, 2025 22:47
Copy link
Contributor

@zy1git zy1git left a comment

Choose a reason for hiding this comment

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

I left some comments for the first round review. Feel free to let me know your thoughts.

assert mae < 2
mae_threshold = 2
if make_input is make_image_cvcuda:
mae_threshold = 3
Copy link
Contributor

Choose a reason for hiding this comment

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

May I know why the threshold becomes 3 here?

rgb = cvcuda.cvtcolor(hsv_modified, cvcuda.ColorConversion.HSV2RGB)

if fp:
rgb = cvcuda.convertto(rgb, cvcuda.Type.F32, scale=256.0 - 1e-3, offset=0.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for using "256.0 - 1e-3" as the scale?

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.

2 participants