Link to this sectionCityscapes8データセット#
Link to this sectionはじめに#
The Ultralytics Cityscapes8 dataset is a compact semantic segmentation dataset with 8 images sampled from the Cityscapes dataset: 4 for training and 4 for validation. It is designed for rapid testing, debugging, and experimentation with YOLO semantic segmentation models and training pipelines. Its urban-scene content provides a useful pipeline check before scaling to the full Cityscapes dataset.
Cityscapes8は、フルサイズのCityscapesデータセットと同じ19の評価クラスとlabel_mapping動作を使用しており、YOLO26セマンティックセグメンテーションワークフローと完全に互換性があります。
Cityscapes8 はあくまでパイプラインのテスト用であり、ベンチマーク用ではありません。8枚という画像数は、意味のある mIoU の比較を行うには少なすぎます。代表的な結果を得るには、Cityscapes の完全な検証セットを使用してください。
Link to this sectionデータセットの構造#
Cityscapes8 はフルデータセットのレイアウトを反映していますが、test 分割は含まれていません。
cityscapes8/
├── images/
│ ├── train/ # 4 images
│ └── val/ # 4 images
└── masks/
├── train/ # 4 single-channel PNG masks
└── val/ # 4 single-channel PNG masksマスクは masks_dir: masks フィールドを介して画像とペアリングされ、label_mapping によってソースである Cityscapes のラベルIDが、Cityscapes データセットの完全な構造で説明されている19個の連続したトレーニングIDに変換されます。
Ultralytics Platform 上の Cityscapes8 を探索して、各画像とセグメンテーションマスクを閲覧し、クラウドでトレーニングするためにクローンを作成してください。
Link to this sectionデータセット YAML#
Cityscapes8データセットの構成は、データセットパス、クラス名、その他重要なメタデータを指定するデータセットYAMLファイルで定義されています。公式のcityscapes8.yamlファイルは、Ultralytics GitHubリポジトリで確認できます。このYAMLには、小さなパッケージ化されたサブセットのダウンロードURLが含まれています。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# Cityscapes semantic segmentation dataset (19 classes)
# Documentation: https://docs.ultralytics.com/datasets/semantic/cityscapes8
# Example usage: yolo semantic train data=cityscapes8.yaml model=yolo26n-sem.pt
# parent
# ├── ultralytics
# └── datasets
# └── cityscapes8 ← downloads here (small subset)
# └── images
# └── masks
# Dataset root directory
path: cityscapes8 # dataset root dir
train: images/train # train images (relative to 'path') 4 images
val: images/val # val images (relative to 'path') 4 images
masks_dir: masks # semantic mask directory
# Cityscapes 19-class labels
names:
0: road
1: sidewalk
2: building
3: wall
4: fence
5: pole
6: traffic light
7: traffic sign
8: vegetation
9: terrain
10: sky
11: person
12: rider
13: car
14: truck
15: bus
16: train
17: motorcycle
18: bicycle
# Map source label IDs to train IDs; ignore_label is converted to 255.
label_mapping:
-1: ignore_label
0: ignore_label
1: ignore_label
2: ignore_label
3: ignore_label
4: ignore_label
5: ignore_label
6: ignore_label
7: 0
8: 1
9: ignore_label
10: ignore_label
11: 2
12: 3
13: 4
14: ignore_label
15: ignore_label
16: ignore_label
17: 5
18: ignore_label
19: 6
20: 7
21: 8
22: 9
23: 10
24: 11
25: 12
26: 13
27: 14
28: 15
29: ignore_label
30: ignore_label
31: 16
32: 17
33: 18
# Download URL (optional)
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/cityscapes8.zipLink to this section使用方法#
Cityscapes8データセットで画像サイズ1024、100 エポックの条件でYOLO26n-semモデルをトレーニングするには、以下の例を使用してください。トレーニングオプションの全リストについては、YOLOトレーニングドキュメントを参照してください。
from ultralytics import YOLO
# Load a pretrained YOLO26n-sem model
model = YOLO("yolo26n-sem.pt")
# Train the model on Cityscapes8
results = model.train(data="cityscapes8.yaml", epochs=100, imgsz=1024)Link to this section引用、ライセンス、謝辞#
Cityscapes8 は Cityscapes からサンプリングされたものです。Cityscapes はカスタム非商用ライセンスの下で公開されています。詳細については、Cityscapes データセットのページを参照してください。
Cityscapesデータセットを研究や開発で使用する場合は、以下の論文を引用してください。
@inproceedings{Cordts2016Cityscapes,
title={The Cityscapes Dataset for Semantic Urban Scene Understanding},
author={Cordts, Marius and Omran, Mohamed and Ramos, Sebastian and Rehfeld, Timo and Enzweiler, Markus and Benenson, Rodrigo and Franke, Uwe and Roth, Stefan and Schiele, Bernt},
booktitle={Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2016}
}Special thanks to the Cityscapes team for their ongoing contributions to the autonomous driving and computer vision communities.
Link to this sectionよくある質問 (FAQ)#
Link to this sectionUltralytics Cityscapes8 データセットは何に使用されますか?#
The Ultralytics Cityscapes8 dataset is designed for rapid testing and debugging of semantic segmentation models. With only 8 images (4 for training, 4 for validation), it is ideal for verifying YOLO semantic segmentation pipelines, including mask loading, augmentations, validation, and export paths, before scaling to the full Cityscapes dataset. Explore the Cityscapes8 YAML configuration for more details.
Link to this sectionCityscapes8 と完全な Cityscapes データセットにはどのような違いがありますか?#
Cityscapes8 samples 8 images (4 train, 4 val) from Cityscapes' 2,975-training/500-validation split, using the same 19 classes and label_mapping, so a pipeline that runs on Cityscapes8 runs unmodified on the full dataset — just point data= at cityscapes.yaml instead of cityscapes8.yaml. Unlike the full dataset, Cityscapes8 has no manual-download step and no test split.
Link to this sectionCityscapes8 データセットを使用して YOLO26 モデルをトレーニングするにはどうすればよいですか?#
PythonまたはCLIを使用して、Cityscapes8上でYOLO26セマンティックセグメンテーションモデルをトレーニングできます。
from ultralytics import YOLO
# Load a pretrained YOLO26n-sem model
model = YOLO("yolo26n-sem.pt")
# Train the model on Cityscapes8
results = model.train(data="cityscapes8.yaml", epochs=100, imgsz=1024)その他のトレーニングオプションについては、YOLO トレーニングのドキュメントを参照してください。
Link to this sectionCityscapes8 をベンチマークに使用すべきですか?#
いいえ。Cityscapes8はモデルの比較を行うには小さすぎるため、トレーニングや評価パイプラインのチェックを目的としています。セマンティックセグメンテーションの代表的なベンチマーク結果が必要な場合は、フルサイズのCityscapes検証セットを使用してください。