Link to this sectionTT100K 数据集#
Tsinghua-Tencent 100K (TT100K) 是一个大规模交通标志基准数据集,由 100,000 张腾讯街景全景图构建而成。该数据集专为真实场景下的交通标志检测与分类而设计,为研究人员和开发者构建稳健的交通标志识别系统提供了综合资源。
该数据集包含 100,000 张图像,拥有超过 30,000 个交通标志实例,涵盖 221 个标注类别。原始论文对每类应用了 100 个实例的阈值进行监督学习,得出了常用的 45 类子集;然而,Ultralytics 提供的相关数据集配置保留了全部 221 个标注类别,其中许多类别的样本非常稀疏。这些图像捕捉了光照、天气条件、视角和距离上的巨大差异,非常适合用于训练需要在多样化真实场景中可靠运行的模型。
该数据集特别适用于:
- 自动驾驶系统
- 高级驾驶辅助系统 (ADAS)
- 交通监控应用
- 城市规划与交通分析
- 真实场景下的计算机视觉研究
Link to this section主要特性#
TT100K 数据集具有几个核心优势:
- 规模:100,000 张高分辨率图像 (2048×2048 像素)
- 多样性:221 个涵盖中国交通标志的类别
- 真实场景:天气、光照和视角差异巨大
- 丰富标注:每个标志都包含类别标签、边界框 (BBox) 和像素掩码
- 全面覆盖:包括禁令、警告、指示和指路标志
- 训练/测试集划分:预定义的划分便于一致性评估
Link to this section数据集结构#
TT100K 数据集分为三个子集:
- 训练集:用于训练模型以检测和分类各类交通标志的主要交通场景图像集合。
- 验证集:在模型开发期间用于监控性能和调整超参数的子集。
- 测试集:用于评估最终模型在真实场景中检测和分类交通标志能力的独立图像集合。
TT100K 数据集包含 221 个交通标志类别,分为几个主要组别:
限速标志 (pl, pm)**
- pl_:限制速度禁止标志(例如 pl5, pl10, pl20, pl30, pl40, pl50, pl60, pl70, pl80, pl100, pl120)
- pm_:最低限速标志(例如 pm5, pm10, pm20, pm30, pm40, pm50, pm55)
禁令标志 (p, pn, pr_)**
- p1-p29:常规禁令标志(禁止通行、禁止停车、禁止停放等)
- pn/pne:禁止通行和禁止停车标志
- pr:各类限制标志(例如 pr10, pr20, pr30, pr40, pr50)
警告标志 (w_)
- w1-w67:针对各类道路危险、状况和情形的警告标志
- 包括人行横道、急转弯、路滑、动物、施工等。
限高/限宽标志 (ph, pb, pw*)**
- ph_:限高标志(例如 ph2, ph2.5, ph3, ph3.5, ph4, ph4.5, ph5)
- pb/pw_:限宽标志
指路标志 (i, il, io, ip)**
- i1-i15:常规指路标志
- il_:限速信息标志(il50, il60, il70, il80, il90, il100, il110)
- io:其他指路标志
- ip:信息板
Link to this section数据集 YAML#
YAML (Yet Another Markup Language) 文件用于定义数据集配置。它包含关于数据集路径、类别及其他相关信息。对于 TT100K 数据集,TT100K.yaml 文件包含了自动下载和转换功能。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# Tsinghua-Tencent 100K (TT100K) dataset https://cg.cs.tsinghua.edu.cn/traffic-sign/ by Tsinghua University
# Documentation: https://cg.cs.tsinghua.edu.cn/traffic-sign/tutorial.html
# Paper: Traffic-Sign Detection and Classification in the Wild (CVPR 2016)
# License: CC BY-NC 2.0 license for non-commercial use only
# Example usage: yolo train data=TT100K.yaml
# parent
# ├── ultralytics
# └── datasets
# └── TT100K ← downloads here (~18 GB)
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: TT100K # dataset root dir
train: images/train # train images (relative to 'path') 6105 images
val: images/val # val images (relative to 'path') 7641 images (original 'other' split)
test: images/test # test images (relative to 'path') 3071 images
# Classes (221 traffic sign categories, 45 with sufficient training instances)
names:
0: i1
1: i10
2: i11
3: i12
4: i13
5: i14
6: i15
7: i2
8: i3
9: i4
10: i5
11: il100
12: il110
13: il50
14: il60
15: il70
16: il80
17: il90
18: io
19: ip
20: p1
21: p10
22: p11
23: p12
24: p13
25: p14
26: p15
27: p16
28: p17
29: p18
30: p19
31: p2
32: p20
33: p21
34: p22
35: p23
36: p24
37: p25
38: p26
39: p27
40: p28
41: p3
42: p4
43: p5
44: p6
45: p7
46: p8
47: p9
48: pa10
49: pa12
50: pa13
51: pa14
52: pa8
53: pb
54: pc
55: pg
56: ph1.5
57: ph2
58: ph2.1
59: ph2.2
60: ph2.4
61: ph2.5
62: ph2.8
63: ph2.9
64: ph3
65: ph3.2
66: ph3.5
67: ph3.8
68: ph4
69: ph4.2
70: ph4.3
71: ph4.5
72: ph4.8
73: ph5
74: ph5.3
75: ph5.5
76: pl10
77: pl100
78: pl110
79: pl120
80: pl15
81: pl20
82: pl25
83: pl30
84: pl35
85: pl40
86: pl5
87: pl50
88: pl60
89: pl65
90: pl70
91: pl80
92: pl90
93: pm10
94: pm13
95: pm15
96: pm1.5
97: pm2
98: pm20
99: pm25
100: pm30
101: pm35
102: pm40
103: pm46
104: pm5
105: pm50
106: pm55
107: pm8
108: pn
109: pne
110: po
111: pr10
112: pr100
113: pr20
114: pr30
115: pr40
116: pr45
117: pr50
118: pr60
119: pr70
120: pr80
121: ps
122: pw2
123: pw2.5
124: pw3
125: pw3.2
126: pw3.5
127: pw4
128: pw4.2
129: pw4.5
130: w1
131: w10
132: w12
133: w13
134: w16
135: w18
136: w20
137: w21
138: w22
139: w24
140: w28
141: w3
142: w30
143: w31
144: w32
145: w34
146: w35
147: w37
148: w38
149: w41
150: w42
151: w43
152: w44
153: w45
154: w46
155: w47
156: w48
157: w49
158: w5
159: w50
160: w55
161: w56
162: w57
163: w58
164: w59
165: w60
166: w62
167: w63
168: w66
169: w8
170: wo
171: i6
172: i7
173: i8
174: i9
175: ilx
176: p29
177: w29
178: w33
179: w36
180: w39
181: w4
182: w40
183: w51
184: w52
185: w53
186: w54
187: w6
188: w61
189: w64
190: w65
191: w67
192: w7
193: w9
194: pax
195: pd
196: pe
197: phx
198: plx
199: pmx
200: pnl
201: prx
202: pwx
203: w11
204: w14
205: w15
206: w17
207: w19
208: w2
209: w23
210: w25
211: w26
212: w27
213: pl0
214: pl4
215: pl3
216: pm2.5
217: ph4.4
218: pn40
219: ph3.3
220: ph2.6
# Download script/URL (optional) ---------------------------------------------------------------------------------------
download: |
import json
import shutil
from pathlib import Path
from PIL import Image
from ultralytics.utils import TQDM
from ultralytics.utils.downloads import download
def tt100k2yolo(dir):
"""Convert TT100K annotations to YOLO format with images/{split} and labels/{split} structure."""
data_dir = dir / "data"
anno_file = data_dir / "annotations.json"
print("Loading annotations...")
with open(anno_file, encoding="utf-8") as f:
data = json.load(f)
# Build class name to index mapping from yaml
names = yaml["names"]
class_to_idx = {v: k for k, v in names.items()}
# Create directories
for split in ["train", "val", "test"]:
(dir / "images" / split).mkdir(parents=True, exist_ok=True)
(dir / "labels" / split).mkdir(parents=True, exist_ok=True)
print("Converting annotations to YOLO format...")
skipped = 0
for img_id, img_data in TQDM(data["imgs"].items(), desc="Processing"):
img_path_str = img_data["path"]
if "train" in img_path_str:
split = "train"
elif "test" in img_path_str:
split = "test"
else:
split = "val"
# Source and destination paths
src_img = data_dir / img_path_str
if not src_img.exists():
continue
dst_img = dir / "images" / split / src_img.name
# Get image dimensions
try:
with Image.open(src_img) as img:
img_width, img_height = img.size
except Exception as e:
print(f"Error reading {src_img}: {e}")
continue
# Copy image to destination
shutil.copy2(src_img, dst_img)
# Convert annotations
label_file = dir / "labels" / split / f"{src_img.stem}.txt"
lines = []
for obj in img_data.get("objects", []):
category = obj["category"]
if category not in class_to_idx:
skipped += 1
continue
bbox = obj["bbox"]
xmin, ymin = bbox["xmin"], bbox["ymin"]
xmax, ymax = bbox["xmax"], bbox["ymax"]
# Convert to YOLO format (normalized center coordinates and dimensions)
x_center = ((xmin + xmax) / 2.0) / img_width
y_center = ((ymin + ymax) / 2.0) / img_height
width = (xmax - xmin) / img_width
height = (ymax - ymin) / img_height
# Clip to valid range
x_center = max(0, min(1, x_center))
y_center = max(0, min(1, y_center))
width = max(0, min(1, width))
height = max(0, min(1, height))
cls_idx = class_to_idx[category]
lines.append(f"{cls_idx} {x_center:.6f} {y_center:.6f} {width:.6f} {height:.6f}\n")
# Write label file
if lines:
label_file.write_text("".join(lines), encoding="utf-8")
if skipped:
print(f"Skipped {skipped} annotations with unknown categories")
print("Conversion complete!")
# Download
dir = Path(yaml["path"]) # dataset root dir
urls = ["https://cg.cs.tsinghua.edu.cn/traffic-sign/data_model_code/data.zip"]
download(urls, dir=dir, curl=True, threads=1)
# Convert
tt100k2yolo(dir)Link to this section用法#
若要使用 YOLO26 模型在 TT100K 数据集上训练 100 个 epochs,且图像大小为 640,你可以使用以下代码片段。数据集将在首次使用时自动下载并转换为 YOLO 格式。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training)
# Train the model - dataset will auto-download on first run
results = model.train(data="TT100K.yaml", epochs=100, imgsz=640)Link to this section样本图像和标注#
以下是来自 TT100K 数据集的典型示例:
- 城市环境:在不同距离处具有多个交通标志的街道场景
- 高速公路场景:包括限速和方向指示在内的高速公路标志
- 复杂交叉路口:在近距离内具有不同朝向的多个标志
- 挑战性条件:处于不同光照(昼/夜)、天气(雨/雾)和视角下的标志
该数据集包括:
- 近景标志:占据大量图像区域、清晰可见的标志
- 远景标志:需要细粒度检测能力的小型标志
- 部分遮挡标志:被车辆、树木或其他物体部分遮挡的标志
- 每张图像多个标志:包含多个不同标志类型的图像
Link to this section引用与致谢#
如果你在研究或开发工作中使用了 TT100K 数据集,请引用以下论文:
@InProceedings{Zhu_2016_CVPR,
author = {Zhu, Zhe and Liang, Dun and Zhang, Songhai and Huang, Xiaolei and Li, Baoli and Hu, Shimin},
title = {Traffic-Sign Detection and Classification in the Wild},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2016}
}我们感谢清华大学和腾讯的合作,共同创建并维护了这一对计算机视觉和自动驾驶社区具有重要价值的资源。有关 TT100K 数据集的更多信息,请访问官方数据集网站。
Link to this section常见问题解答#
Link to this sectionTT100K 数据集有什么用?#
Tsinghua-Tencent 100K (TT100K) 数据集专为真实场景下的交通标志检测与分类而设计。它主要用于:
- 训练自动驾驶感知系统
- 开发高级驾驶辅助系统 (ADAS)
- 研究在多变条件下的稳健目标检测
- 对交通标志识别算法进行基准测试
- 测试模型在大尺寸图像中对小型目标的检测性能
凭借 100,000 张多样化的街景图像和 221 个交通标志类别,它为真实场景下的交通标志检测提供了一个综合测试平台。
Link to this sectionTT100K 中有多少个交通标志类别?#
TT100K 数据集包含 221 个不同的交通标志类别,包括:
- 限速标志:pl* 禁止限速和 pm* 最低限速(例如 pl40, pl120, pm30, pm55)
- 禁令标志:29 种常规禁止类型 (p1-p29) 以及限制标志 (pr*, pn, pne)
- 警告标志:60 多种警告类别 (w1-w67)
- 限高/限宽标志:用于物理限制的 ph* 限高和 pw* 限宽系列
- 指路标志:用于引导和信息的 i1-i15, il*, io, ip
这种全面覆盖包含了中国道路网中发现的大多数交通标志。
Link to this section如何使用 TT100K 数据集训练 YOLO26n 模型?#
若要在 TT100K 数据集上以 640 的图像大小训练 YOLO26n 模型 100 个 epochs,请参考以下示例。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="TT100K.yaml", epochs=100, imgsz=640)有关详细的训练配置,请参阅训练文档。
Link to this section与其他数据集相比,TT100K 的挑战性在哪里?#
TT100K 呈现出几个独特的挑战:
- 尺度变化:标志大小跨度大,从非常小(远处的高速公路标志)到大(近处的城市标志)
- 真实场景:光照、天气和视角的极端差异
- 高分辨率:2048×2048 像素的图像需要强大的处理能力
- 类别不平衡:某些类型的标志比其他类型常见得多
- 密集场景:单张图像中可能出现多个标志
- 部分遮挡:标志可能被车辆、植被或建筑物部分遮挡
这些挑战使得 TT100K 成为开发稳健检测算法的宝贵基准。
Link to this section我该如何处理 TT100K 中的大图像尺寸?#
TT100K 数据集使用 2048×2048 像素的图像,这可能非常消耗资源。以下是推荐的策略:
训练方面:
# Option 1: Resize to standard YOLO size
model.train(data="TT100K.yaml", imgsz=640, batch=16)
# Option 2: Use larger size for better small object detection
model.train(data="TT100K.yaml", imgsz=1280, batch=4)
# Option 3: Multi-scale training
model.train(data="TT100K.yaml", imgsz=640, scale=0.5) # trains at varying scales建议:
- 初次实验请从
imgsz=640开始 - 如果你有充足的 GPU 显存(24GB 以上),请使用
imgsz=1280 - 对于非常小的标志,请考虑使用切片 (tiling) 策略
- 使用梯度累积来模拟更大的 batch size