Oxford-IIIT Pet Dataset Backup
Complete backup of the Oxford-IIIT Pet Dataset containing images of cats and dogs with breed annotations.
Download & Extract
# huggingface_hub 설치 (필요시)
pip install huggingface_hub
# 다운로드
huggingface-cli download leekwoon/oxfordpet_dataset_backup --repo-type dataset --local-dir ./oxfordpet_data
# 무결성 확인 (선택사항)
cd oxfordpet_data
md5sum -c checksums.md5
# 파일 합치기 및 압축 해제
cat data.tar.gz.part_* | tar -xzvf -
Dataset Information
Overview
The Oxford-IIIT Pet Dataset is a 37-category pet dataset with roughly 200 images for each class. The dataset contains images of cats and dogs belonging to 37 breeds, with breed annotations and segmentation masks. It's widely used for fine-grained classification, object detection, and segmentation tasks.
Statistics
- Total Images: ~7,390
- Training Images: ~3,680
- Validation Images: ~370
- Test Images: ~3,340
- Number of Classes: 37 (12 cat breeds + 25 dog breeds)
- Image Format: JPEG
- Average Resolution: Variable (approximately 400x500 pixels)
Directory Structure
oxfordpet/
├── train/ # Training images
│ ├── Abyssinian/ # Cat breed
│ ├── Bengal/ # Cat breed
│ ├── Birman/ # Cat breed
│ ├── Bombay/ # Cat breed
│ ├── British_Shorthair/
│ ├── Egyptian_Mau/
│ ├── Maine_Coon/
│ ├── Persian/
│ ├── Ragdoll/
│ ├── Russian_Blue/
│ ├── Siamese/
│ ├── Sphynx/
│ ├── american_bulldog/ # Dog breed
│ ├── american_pit_bull_terrier/
│ ├── basset_hound/
│ ├── beagle/
│ ├── boxer/
│ ├── chihuahua/
│ ├── english_cocker_spaniel/
│ ├── english_setter/
│ ├── german_shorthaired/
│ ├── great_pyrenees/
│ ├── havanese/
│ ├── japanese_chin/
│ ├── keeshond/
│ ├── leonberger/
│ ├── miniature_pinscher/
│ ├── newfoundland/
│ ├── pomeranian/
│ ├── pug/
│ ├── saint_bernard/
│ ├── samoyed/
│ ├── scottish_terrier/
│ ├── shiba_inu/
│ ├── staffordshire_bull_terrier/
│ └── yorkshire_terrier/
├── val/ # Validation images
│ └── [same structure as train]
└── test/ # Test images
└── [same structure as train]
Pet Breeds
Cat Breeds (12)
- Abyssinian
- Bengal
- Birman
- Bombay
- British Shorthair
- Egyptian Mau
- Maine Coon
- Persian
- Ragdoll
- Russian Blue
- Siamese
- Sphynx
Dog Breeds (25)
- American Bulldog
- American Pit Bull Terrier
- Basset Hound
- Beagle
- Boxer
- Chihuahua
- English Cocker Spaniel
- English Setter
- German Shorthaired Pointer
- Great Pyrenees
- Havanese
- Japanese Chin
- Keeshond
- Leonberger
- Miniature Pinscher
- Newfoundland
- Pomeranian
- Pug
- Saint Bernard
- Samoyed
- Scottish Terrier
- Shiba Inu
- Staffordshire Bull Terrier
- Wheaten Terrier
- Yorkshire Terrier
Usage
Loading with PyTorch
from torchvision import datasets, transforms
transform = transforms.Compose([
transforms.Resize((224, 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('oxfordpet/train', transform=transform)
# Load validation data
val_dataset = datasets.ImageFolder('oxfordpet/val', transform=transform)
# Load test data
test_dataset = datasets.ImageFolder('oxfordpet/test', transform=transform)
# Get class names
class_names = train_dataset.classes
Loading with TensorFlow
import tensorflow as tf
# Define preprocessing
def preprocess_image(image, label):
image = tf.image.resize(image, [224, 224])
image = tf.cast(image, tf.float32) / 255.0
return image, label
# Load dataset
train_ds = tf.keras.preprocessing.image_dataset_from_directory(
'oxfordpet/train',
image_size=(224, 224),
batch_size=32
).map(preprocess_image)
val_ds = tf.keras.preprocessing.image_dataset_from_directory(
'oxfordpet/val',
image_size=(224, 224),
batch_size=32
).map(preprocess_image)
Key Challenges
This dataset presents several interesting challenges:
- Fine-grained classification: Distinguishing between similar breeds
- Pose variation: Pets in various poses and orientations
- Scale variation: Different distances from camera
- Occlusion: Partial visibility of pets
- Background variation: Indoor and outdoor settings
- Intra-class variation: Same breed can look quite different
Dataset Features
- Breed classification: 37 different breeds of cats and dogs
- Species classification: Binary classification (cat vs dog)
- Segmentation masks: Available in original dataset (not included in this backup)
- Head bounding boxes: Available in original dataset (not included in this backup)
Important Notes
- Images have variable sizes and aspect ratios
- Some breeds have more images than others
- Images are real-world photos with natural backgrounds
- File naming convention:
{breed}_{number}.jpg - This is a popular benchmark for fine-grained classification
Citation
If you use this dataset, please cite the original paper:
@InProceedings{parkhi12a,
author = {Parkhi, O. M. and Vedaldi, A. and Zisserman, A. and Jawahar, C.~V.},
title = {Cats and Dogs},
booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
year = {2012}
}
License
The dataset is available for research purposes. The images were collected from the internet and each image may have its own copyright. For commercial use, please refer to the original dataset documentation.
Acknowledgments
This dataset was created by the Visual Geometry Group at the University of Oxford in collaboration with IIIT Hyderabad.