leekwoon's picture
Upload README.md with huggingface_hub
4491651 verified
# ImageNet 2012 Dataset Backup
Complete backup of the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) 2012 dataset.
## Download & Extract
```bash
# huggingface_hub 설치 (필요시)
pip install huggingface_hub
# 다운로드
huggingface-cli download leekwoon/imagenet_dataset_backup --repo-type dataset --local-dir ./imagenet_data
# 무결성 확인 (선택사항)
cd imagenet_data
md5sum -c checksums.md5
# 파일 합치기 및 압축 해제
cat data.tar.gz.part_* | tar -xzvf -
```
## Dataset Information
### Overview
ImageNet is a large-scale hierarchical image database that has been instrumental in advancing deep learning and computer vision research. The ILSVRC 2012 subset is the most commonly used benchmark for image classification tasks.
### Statistics
- **Training Images**: 1,281,167
- **Validation Images**: 50,000
- **Test Images**: 100,000
- **Number of Classes**: 1,000
- **Image Format**: JPEG
- **Average Resolution**: ~469x387 pixels
## Directory Structure
```
imagenet2012/
├── train/ # Training images
│ ├── n01440764/ # Class folder (tench)
│ ├── n01443537/ # Class folder (goldfish)
│ ├── n01484850/ # Class folder (great white shark)
│ └── ... # 997 more class folders
├── val/ # Validation images
│ ├── n01440764/
│ ├── n01443537/
│ ├── n01484850/
│ └── ...
└── test/ # Test images (if available)
└── ...
```
## Class Information
The dataset contains 1,000 object classes from the WordNet hierarchy, including:
- Animals (mammals, birds, fish, reptiles, etc.)
- Plants (trees, flowers, fruits, vegetables)
- Objects (vehicles, furniture, tools, instruments)
- Scenes and structures
Each class is identified by a WordNet ID (synset), such as:
- n01440764: tench (a type of fish)
- n02119789: kit fox
- n07734744: mushroom
- n04515003: upright piano
## Usage
### Loading with PyTorch
```python
from torchvision import datasets, transforms
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]),
])
# Load training data
train_dataset = datasets.ImageFolder('imagenet2012/train', transform=transform)
# Load validation data
val_dataset = datasets.ImageFolder('imagenet2012/val', transform=transform)
```
### Loading with TensorFlow
```python
import tensorflow as tf
def preprocess_image(image):
image = tf.image.resize(image, [224, 224])
image = tf.keras.applications.imagenet_utils.preprocess_input(image)
return image
# Load dataset
train_ds = tf.keras.preprocessing.image_dataset_from_directory(
'imagenet2012/train',
image_size=(224, 224),
batch_size=32
)
```
## Important Notes
- This dataset is for research purposes only
- The original ImageNet dataset requires accepting the terms of use
- Some images may be missing due to broken URLs in the original dataset
- Class labels follow the ILSVRC 2012 convention
## Citation
If you use this dataset, please cite the original ImageNet paper:
```bibtex
@article{deng2009imagenet,
title={ImageNet: A large-scale hierarchical image database},
author={Deng, Jia and Dong, Wei and Socher, Richard and Li, Li-Jia and Li, Kai and Fei-Fei, Li},
journal={2009 IEEE Conference on Computer Vision and Pattern Recognition},
pages={248--255},
year={2009},
organization={IEEE}
}
```
## License
The annotations in this dataset are licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). The images have various licenses that should be checked on the original ImageNet website.