-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add FiveCrop and TenCrop transforms #261
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
Conversation
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.
I think this looks good, thanks Aly!
I have two small comments, but once those are addressed I think this is good to go!
torchvision/transforms.py
Outdated
|
||
def __call__(self, img): | ||
w, h = img.size | ||
crop_w = w // 2 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torchvision/transforms.py
Outdated
bl = img.crop((0, h - crop_h, crop_w, h)) | ||
br = img.crop((w - crop_w, h - crop_h, w, h)) | ||
center = CenterCrop((crop_h, crop_w))(img) | ||
return [tl, tr, bl, br, center] |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@fmassa I've made these changes - let me know if there's anything else that needs changing. |
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!
How about we convert these classes to function |
@chsasank yeah - I think that we should do this. I'll merge this, then you can send a PR to refactor them into functions? |
In response to #61