-
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
Add float support to ColorJitter #2672
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2672 +/- ##
==========================================
- Coverage 72.41% 72.35% -0.07%
==========================================
Files 95 95
Lines 8245 8254 +9
Branches 1308 1312 +4
==========================================
+ Hits 5971 5972 +1
- Misses 1858 1866 +8
Partials 416 416
Continue to review full report at Codecov.
|
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.
Thanks for the PR!
I think there is an issue with the current way you implement this.
Also, could you add tests for using the get_params
interface for the case you are trying to fix?
@@ -1052,18 +1054,26 @@ def get_params(brightness, contrast, saturation, hue): | |||
transforms = [] | |||
|
|||
if brightness is not None: | |||
if isinstance(brightness, float): | |||
ColorJitter._check_input(brightness, 'brightness') |
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 are using the returned value of _check_input
, so this doesn't actually do anything IMO.
Could we instead just do
brightness = ColorJitter._check_input(brightness, 'brightness')
without the conditional on float
?
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.
Yeah that definitely makes sense, not sure how I missed that.
@fmassa according to what we discussed previously, maybe it would be better to get back |
@vfdev-5 the |
Fixes #2669 and adds relevant typing to the arguments.