shijli/voc2012
PASCAL VOC 2012 PASCAL VOC 2012, packed once with a config per task view, so that a project can pull the split it needs without unpacking VOCtrainval_11-May-2012.tar and wiring up paths first. from datasets import load_dataset seg = load_dataset("shijli/voc2012", "segmentation") # 1464 train / 1449 val aug = load_dataset("shijli/voc2012", "segmentation_aug") # 10582 train / 1449 val det = load_dataset("shijli/voc2012", "detection") # 5717 train /… See the full description on the dataset page: https://huggingface.co/datasets/shijli/voc2012.
PASCAL VOC 2012
PASCAL VOC 2012, packed once with a config per task view, so that a project can pull the split it needs without unpacking VOCtrainval_11-May-2012.tar and wiring up paths first.
from datasets import load_dataset
seg = load_dataset("shijli/voc2012", "segmentation") # 1464 train / 1449 val
aug = load_dataset("shijli/voc2012", "segmentation_aug") # 10582 train / 1449 val
det = load_dataset("shijli/voc2012", "detection") # 5717 train / 5823 valConfigs
id is the original VOC image id (2007_000032), so any row joins back to a local VOC checkout.
VOC 2012 withholds its test annotations, so there is no test split.
Masks are labels, not pictures
A mask pixel's value is the class id. Masks are palette (mode P) PNGs, exactly as VOC ships them: 0 is background, 1–20 are the classes below, and 255 marks the void border, which is excluded from both training and scoring rather than being a 21st class.
import numpy as np
mask = np.array(seg["val"][0]["mask"]) # uint8, values in {0..20, 255}Do not call .convert("RGB") on a mask: that turns class ids into display colors and destroys the labels. The palette attached to each mask is for viewing only. Several VOC mirrors store masks as RGB, which forces every consumer to reverse the VOC colormap before the labels mean anything; this one does not.
Classes
background (0), then aeroplane, bicycle, bird, boat, bottle, bus, car, cat, chair, cow, diningtable, dog, horse, motorbike, person, pottedplant, sheep, sofa, train, tvmonitor (1–20). The detection config's objects.label is a ClassLabel over the 20 object classes only, with no background entry, so its indices run 0–19.
The augmented split
segmentation_aug is the standard 10582-image train_aug set: the SBD annotations minus every image held out for validation. Its train masks come from SBD, not from VOC. Its val split uses the official VOC masks, the same 1449 images segmentation scores on, so a model trained on the augmented set is measured against the same ground truth as one that was not.
Detection boxes
objects is a struct of parallel lists: label, bbox, difficult, truncated, pose.
r = det["train"][0]
for label, box in zip(r["objects"]["label"], r["objects"]["bbox"]):
...Boxes are [xmin, ymin, xmax, ymax] exactly as the VOC XML gives them, which is 1-indexed and inclusive on both corners. They are not converted, so they compare directly against the original annotation files. The difficult flag is carried through rather than filtered, since whether to drop those objects is the evaluation protocol's decision.
How this was packed
create_dataset.py in this repo is the script that produced these parquet files, from an unpacked VOC2012 folder. Masks that already carry the VOC palette are published byte for byte; the SBD masks, which ship as mode L with the same pixel values, are re-tagged as mode P with the VOC palette so that every config decodes the same way.
Every mask in every split was checked against the source files after packing: all 14944 of them decode to arrays identical to the originals, with the void marker intact.
The same image appears in more than one config, since each config is self-contained. That is deliberate: it means loading segmentation downloads that split alone rather than the whole image pool.
License and attribution
The images come from flickr and remain under the copyright of their respective owners. They are distributed for non-commercial research and educational use under the terms of the PASCAL VOC challenge. This packaging adds no rights: use it under those same terms and cite the original work.
@article{everingham2015pascal,
title={The Pascal Visual Object Classes Challenge: A Retrospective},
author={Everingham, Mark and Eslami, S. M. Ali and Van Gool, Luc and
Williams, Christopher K. I. and Winn, John and Zisserman, Andrew},
journal={International Journal of Computer Vision},
volume={111}, number={1}, pages={98--136}, year={2015}
}The segmentation_aug train masks are from SBD and should be cited separately:
@inproceedings{hariharan2011semantic,
title={Semantic Contours from Inverse Detectors},
author={Hariharan, Bharath and Arbelaez, Pablo and Bourdev, Lubomir and
Maji, Subhransu and Malik, Jitendra},
booktitle={International Conference on Computer Vision (ICCV)},
year={2011}
}