| --- |
| license: apache-2.0 |
| task_categories: |
| - image-classification |
| tags: |
| - imagenet |
| - computer-vision |
| - imagenet-100 |
| - image-compression |
| - decolorization |
| size_categories: |
| - 100K<n<1M |
| --- |
| |
| # ImageNet-100 Dataset (Zipped ImageFolder) |
|
|
| ### Overview |
| This dataset is a 100-class subset of the ImageNet-2012 (ILSVRC2012) dataset. It was specifically curated for academic research in computer vision, including tasks such as image compression and color-to-grayscale conversion (decolorization). |
|
|
| ### Dataset Details |
| * **Class Selection**: 100 classes were selected using a fixed random seed (42) to ensure reproducibility. |
| * **Format**: The dataset is stored as zipped chunks (10 files total) to facilitate stable uploads and high-speed downloads. |
| * **Total Splits**: |
| * **Train**: ~130,000 images, distributed across 5 ZIP chunks (`part1` to `part5`). |
| * **Validation**: 5,000 images, distributed across 5 ZIP chunks (`part1` to `part5`). |
| * **Labels**: A complete mapping of WordNet IDs to human-readable labels is included in the `Labels.json` file. |
|
|
| ### 📂 Class Categories |
| The 100 selected classes cover a diverse range of categories: |
|
|
| | Category | Count | Examples | |
| | :--- | :---: | :--- | |
| | **Canines (Dogs)** | 13 | Siberian husky, Bloodhound, Miniature schnauzer | |
| | **Birds** | 8 | Hummingbird, Sulphur-crested cockatoo, Goose | |
| | **Primates** | 4 | Chimpanzee, Howler monkey, Macaque | |
| | **Wild Mammals** | 12 | Polar bear, Hippopotamus, Red panda, White wolf | |
| | **Reptiles & Fish** | 8 | Stingray, Bullfrog, Alligator lizard | |
| | **Vehicles** | 5 | Minibus, Moped, Trailer truck | |
| | **Instruments** | 3 | Flute, Bassoon, Trombone | |
| | **Household Items** | 18 | Teapot, Hourglass, Vacuum cleaner, Reflex camera | |
| | **Food & Nature** | 7 | Banana, Mushroom, Seashore, Potpie | |
| | **Sports & Other** | 22 | Volleyball, Baseball, Scuba diver, Stone wall | |
|
|
| --- |
|
|
| ### How to Use |
|
|
| #### 1. Automatic Download and Extraction |
| Since the data is split into multiple chunks, use the following script to reconstruct the `ImageFolder` structure. |
|
|
| ```python |
| import os |
| import zipfile |
| from huggingface_hub import hf_hub_download |
| |
| repo_id = "asafaa/imagent100" |
| target_dir = "./imagenet100" |
| |
| def download_and_extract(split, num_parts=5): |
| for i in range(1, num_parts + 1): |
| filename = f"imagenet100_{split}_part{i}.zip" |
| print(f"Downloading {filename}...") |
| path = hf_hub_download(repo_id=repo_id, filename=filename, repo_type="dataset") |
| |
| with zipfile.ZipFile(path, 'r') as zip_ref: |
| zip_ref.extractall(target_dir) |
| print(f"Finished extracting {split} split.") |
| |
| # Download both splits |
| download_and_extract("train") |
| download_and_extract("val") |