# Cityscapes (2016)

> 5,000 street photos from 50 cities, every pixel labeled as road, car, person, sky and so on.

Page: https://mralbu.github.io/ai-datasets/d/cityscapes

## Key facts

- Category: Vision, Driving
- Task: Semantic segmentation of street scenes
- Creators: Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, Bernt Schiele (Daimler, MPI Informatics, TU Darmstadt)
- Size: 5,000 finely labeled images (2048×1024), plus 20,000 coarsely labeled
- Splits: train 2,975, validation 500, test 1,525
- Input: 2048×1024 photo from a car's windshield camera
- Labels: A class per pixel (30 classes, 19 used in the benchmark), plus instance ids for people and vehicles
- License: Cityscapes license (non-commercial research and teaching; registration required)
- Paper: [The Cityscapes Dataset for Semantic Urban Scene Understanding](https://arxiv.org/abs/1604.01685)
- Homepage: https://www.cityscapes-dataset.com/
- Hugging Face: [Antreas/Cityscapes](https://huggingface.co/datasets/Antreas/Cityscapes)
- Sampled at Hub revision 25f5ec2398eaf27d79bca00c21e269a4d6784286 (2026-11-08)

## Why it matters

Self-driving research needed more than boxes around cars: a car has to know where the road ends and the sidewalk begins. Cityscapes gave 5,000 street scenes from 50 cities with careful pixel-level labels, far more than the few hundred of CamVid or KITTI before it. Its 19-class benchmark, scored by mean IoU, became the standard for semantic segmentation alongside PASCAL VOC and ADE20K, and its color palette (purple road, pink sidewalk, blue cars) is what most people picture when they think of segmentation.

## Worth knowing

- Labeling one image finely took more than 1.5 hours on average, with a quality check after.
- The photos are from 50 cities, mostly in Germany, in spring, summer and fall, in daylight and good or medium weather. No night, rain or snow.
- The car's own hood at the bottom of the frame is a class of its own, "ego vehicle", and is not scored.
- The benchmark ignores rare classes like caravan, trailer and parking; the remaining 19 cover almost all labeled pixels.
- Hover over a photo to see the class under the pointer. The colors are the official Cityscapes palette.

## Get the data

A community Parquet copy of the finely labeled images, with label-id masks. The official download, with coarse labels, instances and video, needs a free account at cityscapes-dataset.com. The viewer serves masks as JPEG, so the sample cleans their edges.

```bash
# pip install -U huggingface_hub
hf download Antreas/Cityscapes --repo-type dataset \
  --local-dir cityscapes
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("Antreas/Cityscapes")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/Antreas/Cityscapes@~parquet/default/val/*.parquet")
print(df.shape)
```

## Related datasets

- [CamVid](https://mi.eng.cam.ac.uk/research/projects/VideoRec/CamVid/): 2008, 701 labeled frames of video from Cambridge, the first of its kind
- [KITTI](https://huggingface.co/datasets/KingRam/Kitti-Object-Detection-Evaluation-2012): 2012, driving benchmark with laser depth; a few hundred segmentation labels (on this site: https://mralbu.github.io/ai-datasets/d/kitti)
- [ADE20K](https://huggingface.co/datasets/1aurent/ADE20K): 2017, scene parsing of everyday scenes, 150 classes (on this site: https://mralbu.github.io/ai-datasets/d/ade20k)
- [Mapillary Vistas](https://www.mapillary.com/dataset/vistas): 2017, 25,000 street images from around the world
- [BDD100K](https://bdd-data.berkeley.edu/): 2018, driving video from US cities, with weather and night
- [NYU Depth V2](https://huggingface.co/datasets/tanganke/nyuv2): 2012, indoor RGB-D scenes with depth and segmentation labels (on this site: https://mralbu.github.io/ai-datasets/d/nyu-depth-v2)

## Landmark papers

- [Pyramid Scene Parsing Network (PSPNet)](https://arxiv.org/abs/1612.01105) (2017)
- [Encoder-Decoder with Atrous Separable Convolution (DeepLabv3+)](https://arxiv.org/abs/1802.02611) (2018)
- [Deep High-Resolution Representation Learning for Visual Recognition (HRNet)](https://arxiv.org/abs/1908.07919) (2019)
- [SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers](https://arxiv.org/abs/2105.15203) (2021)

## Papers on this site that use it

- [PSPNet (2016)](https://mralbu.github.io/ai-datasets/p/pspnet.md): Pooled features across multiple spatial scales so every pixel could use whole-scene context to resolve ambiguity.
- [Mask R-CNN (2017)](https://mralbu.github.io/ai-datasets/p/mask-rcnn.md): Added a small parallel branch to Faster R-CNN that predicts a pixel mask for every detected object.
- [DeepLabv3+ (2018)](https://mralbu.github.io/ai-datasets/p/deeplabv3-plus.md): Paired multi-rate dilated context pooling with a lightweight decoder that sharpens object edges.
- [HRNet (2019)](https://mralbu.github.io/ai-datasets/p/hrnet.md): Kept a high-resolution stream alive all the way through the network instead of downsampling and trying to rebuild detail later.
- [MoCo (2019)](https://mralbu.github.io/ai-datasets/p/moco.md): Built a large, consistent queue of negative keys with a slowly moving momentum encoder so unsupervised pretraining beat supervised ImageNet on transfer.
- [Mask2Former (2021)](https://mralbu.github.io/ai-datasets/p/mask2former.md): Unified semantic, instance and panoptic segmentation into one mask-predicting Transformer with masked cross-attention.
- [SegFormer (2021)](https://mralbu.github.io/ai-datasets/p/segformer.md): Paired a hierarchical, position-free Vision Transformer encoder with a tiny all-MLP decoder.
- [DINOv2 (2023)](https://mralbu.github.io/ai-datasets/p/dinov2.md): Combined image-level self-distillation with patch-level masked modeling on 142 million automatically curated images to produce frozen all-purpose vision features.
- [SAM (2023)](https://mralbu.github.io/ai-datasets/p/sam.md): A model that cuts out whatever you point at, in any image, trained on a billion masks.
