Dataset Viewer
The dataset could not be loaded because the splits use different data file formats, which is not supported. Read more about the splits configuration. Click for more details.
Couldn't infer the same data file format for all splits. Got {NamedSplit('train'): ('text', {}), NamedSplit('validation'): ('text', {}), NamedSplit('test'): ('imagefolder', {})}
Error code:   FileFormatMismatchBetweenSplitsError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Oxford-IIIT Pet Dataset — Object Detection

Derived from the Oxford-IIIT Pet Dataset (Parkhi et al., CVPR 2012).

Task

37-class fine-grained pet head detection — tight head bounding boxes for 12 cat breeds and 25 dog breeds.

Structure

oxford_iiit_pet_dataset/
├── images/
│   ├── train/      2942 images
│   ├── val/         729 images
│   └── test/       3669 images (no bbox annotations)
├── labels/                        ← YOLO labels (Ultralytics convention)
│   ├── train/  (one .txt per image)
│   └── val/    (one .txt per image)
├── annotations/
│   ├── coco/
│   │   ├── instances_train.json
│   │   └── instances_val.json
│   └── yolo/
│       └── data.yaml
└── README.md

Why are YOLO labels in labels/ and not inside annotations/yolo/? Ultralytics automatically resolves label files by replacing images with labels in the image path. With data.yaml setting train: images/train, it looks for labels at labels/train/<stem>.txt — the top-level labels/ directory satisfies this convention directly, avoiding a redundant copy inside annotations/yolo/.

Splits

Split Images Annotations Notes
train 2 942 2 943 bboxes 80 % of annotated images, stratified by breed
val 729 729 bboxes 20 % of annotated images, stratified by breed
test 3 669 Official test split; head bbox annotations not released

Seed: random.seed(42).

Only images with a corresponding PASCAL VOC XML head-annotation are included in train/val (~3 671 of 7 349 total images — all from the original trainval.txt).

Classes

37 breeds (class id 0-indexed, matching YOLO and COCO category_id):

ID Breed Species
0 Abyssinian cat
1 Bengal cat
2 Birman cat
3 Bombay cat
4 British_Shorthair cat
5 Egyptian_Mau cat
6 Maine_Coon cat
7 Persian cat
8 Ragdoll cat
9 Russian_Blue cat
10 Siamese cat
11 Sphynx cat
12 american_bulldog dog
13 american_pit_bull_terrier dog
14 basset_hound dog
15 beagle dog
16 boxer dog
17 chihuahua dog
18 english_cocker_spaniel dog
19 english_setter dog
20 german_shorthaired dog
21 great_pyrenees dog
22 havanese dog
23 japanese_chin dog
24 keeshond dog
25 leonberger dog
26 miniature_pinscher dog
27 newfoundland dog
28 pomeranian dog
29 pug dog
30 saint_bernard dog
31 samoyed dog
32 scottish_terrier dog
33 shiba_inu dog
34 staffordshire_bull_terrier dog
35 wheaten_terrier dog
36 yorkshire_terrier dog

supercategory in COCO JSON is "cat" for ids 0–11, "dog" for ids 12–36.

Annotation formats

COCO (annotations/coco/instances_{split}.json)

Standard COCO detection format. bbox is [x, y, width, height] in pixels (top-left origin). category_id is 0-indexed (0–36).

# Detectron2
from detectron2.data.datasets import register_coco_instances
register_coco_instances("pets_train", {}, "annotations/coco/instances_train.json", "images/train")
register_coco_instances("pets_val",   {}, "annotations/coco/instances_val.json",   "images/val")
# RF-DETR / torchvision
import torchvision.datasets as tvd
ds = tvd.CocoDetection("images/train", "annotations/coco/instances_train.json")

Note: If a loader expects 1-indexed category IDs (e.g. plain Detectron2 without remapping), add 1 to category_id in the JSON or use the loader's thing_dataset_id_to_contiguous_id map.

YOLO (labels/)

One .txt per image, same stem as the image filename. Each line:

<class_id> <cx> <cy> <w> <h>

All values normalised to [0, 1]. Class IDs are 0-indexed (0–36).

data.yaml — plug-and-play for Ultralytics YOLO:

yolo train data=annotations/yolo/data.yaml model=yolo11n.pt epochs=100

Source & Citation

@InProceedings{parkhi12a,
  author       = {Omkar M. Parkhi and Andrea Vedaldi and Andrew Zisserman and C. V. Jawahar},
  title        = {Cats and Dogs},
  booktitle    = {IEEE Conference on Computer Vision and Pattern Recognition},
  year         = {2012},
}

Dataset available at https://www.robots.ox.ac.uk/~vgg/data/pets/.
For research use only — see original dataset terms of use.

Downloads last month
30