https://github.com/dinarior/explore_imagenet
Small tool to explore ImageNet (WordNet) structure.
https://github.com/dinarior/explore_imagenet
explore imagenet machine-learning wordnet
Last synced: 3 months ago
JSON representation
Small tool to explore ImageNet (WordNet) structure.
- Host: GitHub
- URL: https://github.com/dinarior/explore_imagenet
- Owner: dinarior
- License: mit
- Created: 2020-12-23T09:29:28.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-24T05:51:52.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T11:07:42.352Z (8 months ago)
- Topics: explore, imagenet, machine-learning, wordnet
- Language: Python
- Homepage:
- Size: 2.21 MB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Explore Imagenet/WordNet
Tiny package to easily explore the WordNet (and subsequently, ImageNet) structure.
### Usage
```
pip install exin
```
```
from exin.exin import find_class
find_class('n02356798')
```
=>
```
('n00015388', 'animal, animate being, beast, brute, creature, fauna'),
('n01466257', 'chordate'),
('n01471682', 'vertebrate, craniate'),
('n01861778', 'mammal, mammalian'),
('n01886756', 'placental, placental mammal, eutherian, eutherian mammal'),
('n02329401', 'rodent, gnawer'),
('n02355227', 'squirrel'),
('n02355477', 'tree squirrel'),
('n02356798', 'fox squirrel, eastern fox squirrel, Sciurus niger'),
'fox squirrel, eastern fox squirrel, Sciurus niger']
```
This package basically turn the `structure_released.xml` of WordNet to a python dictionary (this was not made with efficiency in mind...) then given a class, say `n02356798`, returns the path from the root, with all the classes id's and descriptions.
You can also access the whole dictionary by using
```
from exin.exin import whole_dict
```
And play with it as you will.
### Alternative
If you dislike installing packages, you can just play with the attached [notebook](https://github.com/dinarior/explore_imagenet/blob/main/explore_imagenet.ipynb) as well for the same functionality.