Meet YOLO26: next-gen vision AI.

Link to this sectionCityscapes 데이터셋#

Cityscapes 데이터셋은 유럽 50개 도시에서 촬영된 도시 거리 장면을 다루는 대규모 semantic segmentation 벤치마크입니다. 이 데이터셋은 고품질의 픽셀 단위 주석을 제공하며, Ultralytics YOLO 모델을 활용한 자율 주행 연구 및 도시 장면 이해를 위해 가장 널리 사용되는 데이터셋 중 하나입니다.

Link to this section주요 특징#

  • Cityscapes 정밀 주석 데이터셋은 2,975개의 학습 이미지, 500개의 검증 이미지, 1,525개의 테스트 이미지로 구성됩니다.
  • 이 데이터셋은 도로, 차량, 보행자, 건설, 사물, 자연, 하늘 범주에 걸쳐 19개의 평가 클래스를 포함합니다.
  • Cityscapes는 semantic segmentation을 위한 mean Intersection over Union(mIoU)과 같은 표준화된 평가 지표를 제공하여 모델 성능을 효과적으로 비교할 수 있게 합니다.

Link to this section데이터셋 구조#

Ultralytics 설정에서는 준비 후 다음과 같은 레이아웃을 사용합니다:

cityscapes/
├── images/
│   ├── train/
│   ├── val/
│   └── test/
└── masks/
    ├── train/
    ├── val/
    └── test/

semantic mask는 단일 채널 PNG 파일입니다. 원본 Cityscapes 라벨 ID는 label_mapping 섹션을 통해 표준 19개 학습 ID로 매핑되며, 무시되거나 빈 라벨은 255로 매핑되어 학습 및 평가에서 제외됩니다. Cityscapes 웹사이트에서 공식 leftImg8bitgtFine 아카이브를 다운로드하여 데이터셋 루트에 압축을 풉니다. 그 후 cityscapes.yaml의 준비 블록을 통해 이미지와 마스크를 해당 레이아웃으로 정리합니다.

Link to this section응용 분야#

Cityscapes는 semantic segmentation 분야의 deep learning 모델을 학습하고 평가하는 데 널리 사용되며, 특히 autonomous driving, 지능형 운전자 보조 시스템(ADAS) 및 도시 로봇 공학 연구에 활용됩니다.

고해상도 이미지와 상세한 주석 덕분에 실시간 장면 분석, 차선 및 장애물 인식, 복잡한 도시 환경에 대한 정밀한 픽셀 단위 이해가 필요한 모든 작업에 유용합니다.

Link to this section데이터셋 YAML#

데이터셋 YAML 파일은 Cityscapes 경로, 클래스, 마스크 디렉토리 및 라벨 매핑을 정의합니다. cityscapes.yaml 파일은 https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/cityscapes.yaml에서 관리됩니다.

ultralytics/cfg/datasets/cityscapes.yaml
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license

# Cityscapes semantic segmentation dataset (19 classes)
# Documentation: https://docs.ultralytics.com/datasets/semantic/cityscapes/
# Example usage: yolo semantic train data=cityscapes.yaml model=yolo26n-sem.pt
# parent
# ├── ultralytics
# └── datasets
#     └── cityscapes ← downloads here (11 GB)
#         └── images
#         └── masks

# Dataset root directory
path: cityscapes # dataset root dir
train: images/train # train images (relative to 'path') 2975 images
val: images/val # val images (relative to 'path') 500 images
test: images/test # test images (relative to 'path') 1525 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

# Preparation script (requires manual Cityscapes download)
download: |
  from pathlib import Path
  from shutil import copy2

  cityscapes_dir = Path(yaml["path"])  # dataset root dir
  # Download and extract the official Cityscapes leftImg8bit and gtFine archives into cityscapes_dir first.
  leftimg8bit_dir = cityscapes_dir / "leftImg8bit"
  gtfine_dir = cityscapes_dir / "gtFine"

  for split in ("train", "val", "test"):
      print(f"Processing {split} set")
      src_image_dir = leftimg8bit_dir / split
      dst_image_dir = cityscapes_dir / "images" / split
      dst_mask_dir = cityscapes_dir / "masks" / split
      dst_image_dir.mkdir(parents=True, exist_ok=True)
      dst_mask_dir.mkdir(parents=True, exist_ok=True)

      image_paths = sorted(src_image_dir.rglob("*_leftImg8bit.png"))
      for image_path in image_paths:
          relative_path = image_path.relative_to(src_image_dir)
          mask_path = gtfine_dir / split / relative_path.parent / image_path.name.replace(
              "_leftImg8bit.png", "_gtFine_labelIds.png"
          )
          if not mask_path.exists():
              raise FileNotFoundError(f"Mask not found for {image_path}: {mask_path}")

          image_name = image_path.name.replace("_leftImg8bit", "")
          mask_name = mask_path.name.replace("_gtFine_labelIds", "")
          copy2(image_path, dst_image_dir / image_name)
          copy2(mask_path, dst_mask_dir / mask_name)

Link to this section사용법#

Cityscapes 데이터셋에서 이미지 크기 1024로 YOLO26n-sem 모델을 100 epochs 동안 학습하려면 다음 코드 스니펫을 사용할 수 있습니다. 사용 가능한 인수에 대한 전체 목록은 모델 Training 페이지를 참조하십시오.

학습 예시
from ultralytics import YOLO

# Load a model
model = YOLO("yolo26n-sem.pt")  # load a pretrained model (recommended for training)

# Train the model
results = model.train(data="cityscapes.yaml", epochs=100, imgsz=1024)

Link to this section인용 및 감사의 글#

연구 또는 개발 작업에서 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 팀에 감사드립니다. Cityscapes 데이터셋과 제작자에 대한 자세한 내용은 Cityscapes 데이터셋 웹사이트를 방문하십시오.

Link to this sectionFAQ#

Link to this sectionCityscapes 데이터셋이란 무엇이며 컴퓨터 비전에서 왜 중요한가요?#

Cityscapes 데이터셋은 유럽 50개 도시에서 촬영된 도시 거리 장면을 다루는 대규모 semantic segmentation 벤치마크입니다. 19개의 평가 클래스에 걸쳐 5,000개의 정밀 주석 이미지를 포함하고 있어 자율 주행 및 도시 장면 이해 연구의 기초적인 리소스가 됩니다. 고해상도 이미지, 밀도 높은 주석, 표준화된 mIoU 지표는 dense prediction 모델을 벤치마킹하는 데 이상적입니다.

Link to this sectionCityscapes 데이터셋을 사용하여 어떻게 YOLO 모델을 학습할 수 있나요?#

Cityscapes 데이터셋에서 이미지 크기 1024로 YOLO26n-sem 모델을 100 epoch 동안 학습하려면 다음 코드 스니펫을 사용할 수 있습니다. 사용 가능한 인수에 대한 자세한 목록은 모델 Training 페이지를 참조하십시오.

학습 예시
from ultralytics import YOLO

# Load a model
model = YOLO("yolo26n-sem.pt")  # load a pretrained model (recommended for training)

# Train the model
results = model.train(data="cityscapes.yaml", epochs=100, imgsz=1024)

Link to this sectionCityscapes 데이터셋은 어떻게 구성되어 있나요?#

데이터셋 준비 후, images/{train,val,test}/masks/{train,val,test}/ 디렉토리로 구성되며 각 이미지는 단일 채널 PNG 마스크와 쌍을 이룹니다. Ultralytics YAML 파일은 masks_dir: masks 필드를 통해 각 이미지와 마스크를 연결하며, label_mapping을 사용하여 원본 Cityscapes 라벨 ID를 표준 19개 연속 학습 ID로 변환하고, 무시되거나 빈 라벨은 255로 매핑합니다.

Link to this sectionCityscapes를 수동으로 다운로드해야 하나요?#

네. Cityscapes는 공식 웹사이트에서 데이터셋 이용 약관에 동의해야 합니다. leftImg8bitgtFine을 다운로드하여 cityscapes 데이터셋 루트에 압축을 푼 다음, cityscapes.yaml의 준비 블록을 사용하여 예상되는 images/masks/ 레이아웃을 생성하십시오.

Link to this sectionCityscapes에서 label_mapping을 사용하는 이유는 무엇인가요?#

Cityscapes 소스 마스크에는 평가에 사용되는 19개 학습 ID와 다른 원본 라벨 ID가 저장되어 있습니다. label_mapping 섹션은 유효한 라벨을 연속적인 클래스 ID 0~18로 변환하고, 무시되거나 빈 라벨에는 255를 할당하여 학습 및 검증 중에 손실 계산 및 지표에서 제외되도록 합니다.

댓글