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 more transform examples in gallery #3698

Merged
merged 7 commits into from
Apr 21, 2021
Merged

Add more transform examples in gallery #3698

merged 7 commits into from
Apr 21, 2021

Conversation

harishsdev
Copy link
Contributor

@harishsdev
Copy link
Contributor Author

Added as per below PR #3688

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks @harishsdev ! I made a few comments but this looks good.

The docs seem to not compile properly, you can build them locally to check any potential issue by following the instructions here: https://github.com/pytorch/vision/blob/master/CONTRIBUTING.md#documentation

Comment on lines 121 to 122
# RandomHorizontalFlip
# ------------
Copy link
Member

Choose a reason for hiding this comment

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

The doc building is failing because the underline --- is shorter than the title. Would you mind fixing these so that every title matches the underline (here and everywhere else)

plot(randomcrop_img, "Random Cropped transformed image")

####################################
# RandomGrayscale
Copy link
Member

Choose a reason for hiding this comment

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

Since the Grayscale transform is very similar and already documented above, I think we don't need a new section for this one. How about just adding (addition in bold) above:

(see also to_grayscale and RandomGrayscale)

make sure that the links are properly rendered, you'll need to use :class:`~torchvision.transforms.RandomGrayScale`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @NicolasHug removed RandomGrayscale

# The :class:`~torchvision.transforms.RandomCrop` transform
# (see also :func:`~torchvision.transforms.functional.crop`)
# performs random crop transform on an image.
randomcrop_img = T.RandomCrop(size=(128, 128))(orig_img)
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: here and in other places:

Suggested change
randomcrop_img = T.RandomCrop(size=(128, 128))(orig_img)
random_crop_img = T.RandomCrop(size=(128, 128))(orig_img)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @NicolasHug done for all the variables as per your suggestion

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks @harishsdev ! I pushed some minor changes / fixes in the last 2 commits. LGTM!

@NicolasHug NicolasHug changed the title Added examples for transforms RandomApply,RandomCrop,RandomGrayscale etc Add more transform examples in gallery Apr 21, 2021
@NicolasHug NicolasHug merged commit d9338f3 into pytorch:master Apr 21, 2021
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.

None yet

3 participants