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 classes to the Flowers102 dataset #8838

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

ageron
Copy link
Contributor

@ageron ageron commented Jan 6, 2025

Many datasets provide class names, why not Flowers102?
This PR adds the class names to the Flowers102 class.

Copy link

pytorch-bot bot commented Jan 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8838

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

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.

Thansk for the PR @ageron , this looks good. Just to make sure these are correct, can you share how you created the classes list?

@ageron
Copy link
Contributor Author

ageron commented Jan 13, 2025

Hi Nicolas,
The official page lists all the categories, but only shows their counts, not their order: https://www.robots.ox.ac.uk/~vgg/data/flowers/102/categories.html

So I looked for other sources and found several:

They all agree. I checked that the label counts match, and they all do (adding the training set, validation set, and test set). However, some counts have duplicates:

40 {'prince of wales feathers', 'moon orchid', 'bolero deep blue', 'fire lily', 'pink primrose', 'canterbury bells', 'mexican aster'}
41 {'toad lily', 'grape hyacinth', 'siam tulip', 'corn poppy', 'globe-flower'}
42 {'red ginger', 'spring crocus'}
45 {'globe thistle', 'garden phlox', 'tiger lily'}
46 {'ball moss', 'monkshood', 'love in the mist'}
48 {'spear thistle', 'blackberry lily'}
49 {'oxeye daisy', 'yellow iris', 'blanket flower', 'balloon flower', 'king protea'}
52 {'silverbush', 'carnation'}
54 {'black-eyed susan', 'bearded iris', 'windflower'}
56 {'sweet pea', 'giant white arum lily', 'great masterwort'}
58 {'trumpet creeper', 'tree mallow'}
59 {'pincushion flower', 'daffodil'}
61 {'sunflower', 'osteospermum'}
63 {'desert-rose', 'magnolia', 'bromelia'}
66 {'stemless gentian', 'mallow', 'bee balm'}
67 {'marigold', 'orange dahlia', 'lenten rose', 'gaura'}
71 {'pelargonium', 'buttercup'}
78 {'artichoke', 'gazania'}
82 {'mexican petunia', 'peruvian lily', 'canna lily'}
85 {'sweet william', 'bird of paradise', 'wild pansy', 'purple coneflower'}
87 {'snapdragon', "colt's foot"}
91 {'fritillary', 'camellia'}
93 {'poinsettia', 'primula'}
109 {'pink-yellow dahlia?', 'bishop of llandaff'}

So it's possible that some of these are inverted. That said, I spot checked a few and they looked like the flowers on the Wikipedia, so I'm pretty confident about these labels.

@ageron
Copy link
Contributor Author

ageron commented Feb 3, 2025

Hi there, does this PR need any tweak or can it be merged?

@NicolasHug
Copy link
Member

Thanks @ageron , nothing more to do on your side. I'll merge it eventually, when I have more time to dedicate to torchvision.

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 again @ageron

@NicolasHug NicolasHug merged commit a200dac into pytorch:main Feb 19, 2025
29 of 48 checks passed
@ageron ageron deleted the add_flowers102_classes branch February 20, 2025 02:23
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