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