Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,71 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import zipfile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
zip_ref.extractall("./data")
|
| 8 |
-
2. Local Training (PyTorch)Once extracted, use torchvision.datasets.ImageFolder:Pythonfrom torchvision.datasets import ImageFolder
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- image-classification
|
| 5 |
+
tags:
|
| 6 |
+
- imagenet
|
| 7 |
+
- computer-vision
|
| 8 |
+
- imagenet-100
|
| 9 |
+
- image-compression
|
| 10 |
+
- decolorization
|
| 11 |
+
size_categories:
|
| 12 |
+
- 100K<n<1M
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# ImageNet-100 Dataset (Zipped ImageFolder)
|
| 16 |
+
|
| 17 |
+
### Overview
|
| 18 |
+
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).
|
| 19 |
+
|
| 20 |
+
### Dataset Details
|
| 21 |
+
* **Class Selection**: 100 classes were selected using a fixed random seed (42) to ensure reproducibility.
|
| 22 |
+
* **Format**: The dataset is stored as zipped chunks (10 files total) to facilitate stable uploads and high-speed downloads.
|
| 23 |
+
* **Total Splits**:
|
| 24 |
+
* **Train**: ~130,000 images, distributed across 5 ZIP chunks (`part1` to `part5`).
|
| 25 |
+
* **Validation**: 5,000 images, distributed across 5 ZIP chunks (`part1` to `part5`).
|
| 26 |
+
* **Labels**: A complete mapping of WordNet IDs to human-readable labels is included in the `Labels.json` file.
|
| 27 |
+
|
| 28 |
+
### 📂 Class Categories
|
| 29 |
+
The 100 selected classes cover a diverse range of categories:
|
| 30 |
+
|
| 31 |
+
| Category | Count | Examples |
|
| 32 |
+
| :--- | :---: | :--- |
|
| 33 |
+
| **Canines (Dogs)** | 13 | Siberian husky, Bloodhound, Miniature schnauzer |
|
| 34 |
+
| **Birds** | 8 | Hummingbird, Sulphur-crested cockatoo, Goose |
|
| 35 |
+
| **Primates** | 4 | Chimpanzee, Howler monkey, Macaque |
|
| 36 |
+
| **Wild Mammals** | 12 | Polar bear, Hippopotamus, Red panda, White wolf |
|
| 37 |
+
| **Reptiles & Fish** | 8 | Stingray, Bullfrog, Alligator lizard |
|
| 38 |
+
| **Vehicles** | 5 | Minibus, Moped, Trailer truck |
|
| 39 |
+
| **Instruments** | 3 | Flute, Bassoon, Trombone |
|
| 40 |
+
| **Household Items** | 18 | Teapot, Hourglass, Vacuum cleaner, Reflex camera |
|
| 41 |
+
| **Food & Nature** | 7 | Banana, Mushroom, Seashore, Potpie |
|
| 42 |
+
| **Sports & Other** | 22 | Volleyball, Baseball, Scuba diver, Stone wall |
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### How to Use
|
| 47 |
+
|
| 48 |
+
#### 1. Automatic Download and Extraction
|
| 49 |
+
Since the data is split into multiple chunks, use the following script to reconstruct the `ImageFolder` structure.
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
import os
|
| 53 |
import zipfile
|
| 54 |
+
from huggingface_hub import hf_hub_download
|
| 55 |
+
|
| 56 |
+
repo_id = "asafaa/imagent100"
|
| 57 |
+
target_dir = "./imagenet100"
|
| 58 |
+
|
| 59 |
+
def download_and_extract(split, num_parts=5):
|
| 60 |
+
for i in range(1, num_parts + 1):
|
| 61 |
+
filename = f"imagenet100_{split}_part{i}.zip"
|
| 62 |
+
print(f"Downloading {filename}...")
|
| 63 |
+
path = hf_hub_download(repo_id=repo_id, filename=filename, repo_type="dataset")
|
| 64 |
+
|
| 65 |
+
with zipfile.ZipFile(path, 'r') as zip_ref:
|
| 66 |
+
zip_ref.extractall(target_dir)
|
| 67 |
+
print(f"Finished extracting {split} split.")
|
| 68 |
|
| 69 |
+
# Download both splits
|
| 70 |
+
download_and_extract("train")
|
| 71 |
+
download_and_extract("val")
|
|
|
|
|
|