Skip to content
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

Merged
merged 6 commits into from
Feb 28, 2022
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Feb 28, 2022

#5411 for prototype transforms.

@facebook-github-bot
Copy link

facebook-github-bot commented Feb 28, 2022

💊 CI failures summary and remediations

As 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.

Click here to manually regenerate this comment.

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.

Thanks for the changes. Overall it looks good but I've added question on a few spots:

torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
Conflicts:
	torchvision/prototype/transforms/_auto_augment.py
	torchvision/prototype/transforms/_utils.py
Comment on lines +17 to +26
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Although this looks like a new concept, it was in fact copy-pasted from #5422 where we need the same kind of functionality. I suggest to leave this here for now and let #5422 handle the more elaborate case.

Copy link
Contributor

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?

Copy link
Collaborator Author

@pmeier pmeier Feb 28, 2022

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.

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.

Looks good, only minor comments:

torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
Comment on lines +17 to +26
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
Copy link
Contributor

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?

torchvision/prototype/transforms/_auto_augment.py Outdated Show resolved Hide resolved
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.

LGTM, thanks!

@datumbox datumbox merged commit 95d4189 into pytorch:main Feb 28, 2022
facebook-github-bot pushed a commit that referenced this pull request Mar 5, 2022
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
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.

3 participants