Skip to content

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.

@pytorch-bot
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
facebook-github-bot pushed a commit that referenced this pull request Jul 9, 2025
Reviewed By: scotts Differential Revision: D77997075 fbshipit-source-id: 70a5da9e3d198f94df88060dee1e8f8c107579e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment