Ultralytics YOLO27:

Cityscapes8データセット#

はじめに#

UltralyticsのCityscapes8データセットは、Cityscapesデータセットからサンプリングした8枚の画像(トレーニング用4枚、検証用4枚)で構成されるコンパクトなセマンティックセグメンテーションデータセットです。YOLOのセマンティックセグメンテーションモデルやトレーニングパイプラインの迅速なテスト、デバッグ、実験向けに設計されています。都市シーンのデータが含まれているため、完全なCityscapesデータセットへ拡張する前のパイプラインチェックに役立ちます。

Cityscapes8は、完全なCityscapesデータセットと同じ19個の評価クラスおよび同じlabel_mappingの動作を使用し、YOLO26のセマンティックセグメンテーションワークフローと完全に互換性があります。

注記

Cityscapes8はベンチマーク用ではなく、パイプラインテスト専用です。8枚の画像では、有意義なmIoU比較を行うには少なすぎます。代表的な結果を得るには、完全なCityscapes検証セットを使用してください。

データセットの構成#

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データセット構造で説明されている19個の連続したtrain IDに、元のCityscapesラベルIDが変換されます。

データセット YAML#

Cityscapes8データセットの設定はデータセットYAMLファイルで定義されており、データセットのパス、クラス名、その他の重要なメタデータを指定します。Ultralytics GitHubリポジトリで公式のcityscapes8.yamlファイルを確認できます。YAMLには、小規模なパッケージ化サブセットのダウンロードURLが含まれています。

ultralytics/cfg/datasets/cityscapes8.yaml
# 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.zip

使用方法#

Cityscapes8データセットでYOLO26n-semモデルを、画像サイズ1024、100エポックでトレーニングするには、次の例を使用してください。トレーニングオプションの一覧については、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)

Ultralytics Platformを使用すると、クラウド上でCityscapes8を管理し、セマンティックセグメンテーションモデルをトレーニングすることもできます。

引用、ライセンス、謝辞#

Cityscapes8は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}
}

自動運転およびコンピュータービジョンコミュニティへの継続的な貢献に対し、Cityscapesチームに特別な謝意を表します。

FAQ#

  • Ultralytics Cityscapes8データセットは、セマンティックセグメンテーションモデルの迅速なテストとデバッグ向けに設計されています。画像は8枚(トレーニング用4枚、検証用4枚)のみであるため、完全なCityscapesデータセットへ拡張する前に、マスクの読み込み、データ拡張、検証、エクスポートパスなど、YOLOのセマンティックセグメンテーションパイプラインを検証するのに適しています。詳細については、Cityscapes8 YAML設定を確認してください。

  • Cityscapes8は、Cityscapesのトレーニング2,975枚/検証500枚の分割から、同じ19クラスとlabel_mappingを使用して8枚の画像(トレーニング4枚、検証4枚)をサンプリングします。そのため、Cityscapes8で実行できるパイプラインは、変更せずに完全なデータセットでも実行できます。cityscapes8.yamlの代わりに、data=cityscapes.yamlを指すようにするだけです。完全なデータセットとは異なり、Cityscapes8には手動ダウンロードの手順とtest分割がありません。

  • 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トレーニングドキュメントを参照してください。

  • いいえ。Cityscapes8は意味のあるモデル比較を行うには小さすぎるため、トレーニングおよび評価パイプラインのチェックを目的としています。セマンティックセグメンテーションで代表的なベンチマーク結果が必要な場合は、完全なCityscapes検証セットを使用してください。

コメント