Link to this sectionTập dữ liệu Cityscapes8#
Link to this sectionGiới thiệu#
Tập dữ liệu Cityscapes8 của Ultralytics là tập dữ liệu phân đoạn ngữ nghĩa nhỏ gọn với 8 hình ảnh được lấy mẫu từ tập dữ liệu Cityscapes: 4 ảnh để huấn luyện và 4 ảnh để kiểm thử. Nó được thiết kế để thử nghiệm nhanh, gỡ lỗi và thực nghiệm với các model phân đoạn ngữ nghĩa YOLO và các pipeline huấn luyện. Nội dung cảnh quan đô thị của nó cung cấp một quy trình kiểm tra pipeline hữu ích trước khi mở rộng quy mô lên tập dữ liệu Cityscapes đầy đủ.
Cityscapes8 sử dụng 19 lớp đánh giá và hành vi label_mapping giống như tập dữ liệu Cityscapes đầy đủ, và hoàn toàn tương thích với các workflow semantic segmentation của YOLO26.
Link to this sectionYAML tập dữ liệu#
Cấu hình tập dữ liệu Cityscapes8 được xác định trong một file YAML, trong đó chỉ định các đường dẫn tập dữ liệu, tên lớp và các metadata thiết yếu khác. Bạn có thể xem file cityscapes8.yaml chính thức trong kho lưu trữ GitHub của Ultralytics. File YAML bao gồm một URL tải xuống cho tập con nhỏ đã được đóng gói.
# 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 sectionCách sử dụng#
Để huấn luyện model YOLO26n-sem trên tập dữ liệu Cityscapes8 trong 100 epochs với kích thước ảnh là 1024, hãy sử dụng các ví dụ sau đây. Để có danh sách đầy đủ các tùy chọn huấn luyện, hãy xem tài liệu Huấn luyện 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 sectionTrích dẫn và Ghi nhận#
Nếu bạn sử dụng tập dữ liệu Cityscapes trong nghiên cứu hoặc phát triển của mình, vui lòng trích dẫn bài báo sau:
@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}
}Xin gửi lời cảm ơn đặc biệt đến đội ngũ Cityscapes vì những đóng góp liên tục của họ cho cộng đồng xe tự lái và computer vision.
Link to this sectionCâu hỏi thường gặp#
Link to this sectionTập dữ liệu Cityscapes8 của Ultralytics được dùng để làm gì?#
Tập dữ liệu Cityscapes8 của Ultralytics được thiết kế để thử nghiệm và gỡ lỗi nhanh các model phân đoạn ngữ nghĩa. Chỉ với 8 hình ảnh (4 ảnh để huấn luyện, 4 ảnh để kiểm thử), nó rất lý tưởng để xác minh các pipeline phân đoạn ngữ nghĩa YOLO, bao gồm việc tải mask, tăng cường dữ liệu, kiểm thử và các đường dẫn xuất, trước khi mở rộng quy mô lên tập dữ liệu Cityscapes đầy đủ. Khám phá cấu hình YAML của Cityscapes8 để biết thêm chi tiết.
Link to this sectionLàm thế nào để huấn luyện model YOLO26 bằng tập dữ liệu Cityscapes8?#
Bạn có thể huấn luyện model semantic segmentation YOLO26 trên Cityscapes8 bằng Python hoặc CLI:
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)Để biết các tùy chọn huấn luyện bổ sung, hãy tham khảo tài liệu về Huấn luyện YOLO.
Link to this sectionTôi có nên sử dụng Cityscapes8 để làm benchmark không?#
Không. Cityscapes8 quá nhỏ để so sánh model một cách có ý nghĩa và chỉ dành cho việc kiểm tra pipeline huấn luyện và đánh giá. Hãy sử dụng tập kiểm thử đầy đủ của Cityscapes khi bạn cần kết quả benchmark đại diện cho semantic segmentation.