-
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 prototype AugMix transform #5492
Conversation
💊 CI failures summary and remediationsAs of commit 3a455d8 (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. |
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 changes. Overall it looks good but I've added question on a few spots:
Conflicts: torchvision/prototype/transforms/_auto_augment.py torchvision/prototype/transforms/_utils.py
def _put_into_sample(sample: Any, id: Tuple[Any, ...], item: Any) -> Any: | ||
if not id: | ||
return item | ||
|
||
parent = sample | ||
for key in id[:-1]: | ||
parent = parent[key] | ||
|
||
parent[id[-1]] = item | ||
return sample |
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.
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.
Should we put it on ._utils
?
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.
It probably should be in torchvision.utils._internal
since it will be needed in torchvision.prototype.datasets
. Given that we currently only need it here, I would leave it to #5422 to do this properly and remove the definition here.
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.
Looks good, only minor comments:
def _put_into_sample(sample: Any, id: Tuple[Any, ...], item: Any) -> Any: | ||
if not id: | ||
return item | ||
|
||
parent = sample | ||
for key in id[:-1]: | ||
parent = parent[key] | ||
|
||
parent[id[-1]] = item | ||
return sample |
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.
Should we put it on ._utils
?
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.
LGTM, thanks!
Summary: * add prototype AugMix transform * cleanup * refactor auto augment subclasses to only trnasform a single image * address review comments Reviewed By: datumbox Differential Revision: D34579510 fbshipit-source-id: b483642885913f844ffd72ef449de5a82467fc78
#5411 for prototype transforms.