ADE20K 数据集#
ADE20K 数据集是由 MIT CSAIL 提供的大规模语义分割基准,包含 20,210 张训练图像和 2,000 张验证图像,涵盖室内、室外、物体和 stuff 类别,共 150 个类别,并进行了密集标注。它是使用 Ultralytics YOLO 训练和评估密集场景理解模型的标准资源。
主要特性#
- ADE20K 的完整 SceneParsing 基准共包含 25,562 张图像:20,210 张用于训练,2,000 张用于验证,3,352 张用于测试。测试图像的标注未公开发布,因此可下载的
ADEChallengeData2016压缩包和 Ultralytics 的ade20k.yaml配置仅使用训练集和验证集。 - 该数据集涵盖 150 个语义类别,包括室内、室外、物体和 stuff 类别。
- 标注是密集的像素级分割掩码,适用于场景解析。
数据集结构#
Ultralytics 配置要求使用官方的 ADEChallengeData2016 目录结构:
ADEChallengeData2016/
├── images/
│ ├── training/
│ └── validation/
└── annotations/
├── training/
└── validation/ADE20K 没有自动下载脚本。下载约 ~1 GB 的 ADEChallengeData2016.zip 压缩包,并将其直接解压到你的 datasets/ 文件夹中。压缩包自身的顶层文件夹已经命名为 ADEChallengeData2016/,因此这样操作会生成与上述结构匹配的 datasets/ADEChallengeData2016/——不要自行创建 ADEChallengeData2016 文件夹再将压缩包解压到其中,否则会生成 YAML 无法找到的嵌套 datasets/ADEChallengeData2016/ADEChallengeData2016/ 目录。
masks_dir 字段设置为 annotations,因此 images/ 下的每张图像都会与 annotations/ 下对应的掩码配对。原始 ADE20K 掩码使用源标签 ID,其中 0 表示忽略标签;label_mapping 部分会将有效标签 1 到 150 转换为连续的训练 ID 0 到 149,并将忽略像素映射到 255。
应用#
ADE20K 广泛用于训练和评估语义分割与场景解析中的深度学习模型。其多样的类别和复杂的场景使其适用于自动导航、机器人技术、增强现实和图像编辑等应用。
室内和室外场景的广泛覆盖也使 ADE20K 成为评估模型跨领域泛化能力的强大基准。在 ADE20K 验证集上,预训练的 YOLO26 语义分割模型的 mIoU 最高可达 51.5;有关完整的基准测试表,请参阅语义分割模型页面。ADE20K 格式的数据集也完全兼容 Ultralytics Platform,可用于数据集管理和训练。
数据集 YAML#
数据集 YAML 文件定义了 ADE20K 的路径、类别、掩码目录和标签映射。ade20k.yaml 文件维护在 https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/ade20k.yaml。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# ADE20K semantic segmentation dataset (150 classes)
# Documentation: https://docs.ultralytics.com/datasets/semantic/ade20k
# Example usage: yolo semantic train data=ade20k.yaml model=yolo26n-sem.pt
# parent
# ├── ultralytics
# └── datasets
# └── ADEChallengeData2016 ← downloads here (1 GB)
# └── images
# └── annotations
# Dataset root directory
path: ADEChallengeData2016
train: images/training
val: images/validation
masks_dir: annotations # semantic mask directory
# ADE20K 150-class labels
names:
0: wall
1: building
2: sky
3: floor
4: tree
5: ceiling
6: road
7: bed
8: windowpane
9: grass
10: cabinet
11: sidewalk
12: person
13: earth
14: door
15: table
16: mountain
17: plant
18: curtain
19: chair
20: car
21: water
22: painting
23: sofa
24: shelf
25: house
26: sea
27: mirror
28: rug
29: field
30: armchair
31: seat
32: fence
33: desk
34: rock
35: wardrobe
36: lamp
37: bathtub
38: railing
39: cushion
40: base
41: box
42: column
43: signboard
44: chest of drawers
45: counter
46: sand
47: sink
48: skyscraper
49: fireplace
50: refrigerator
51: grandstand
52: path
53: stairs
54: runway
55: case
56: pool table
57: pillow
58: screen door
59: stairway
60: river
61: bridge
62: bookcase
63: blind
64: coffee table
65: toilet
66: flower
67: book
68: hill
69: bench
70: countertop
71: stove
72: palm
73: kitchen island
74: computer
75: swivel chair
76: boat
77: bar
78: arcade machine
79: hovel
80: bus
81: towel
82: light
83: truck
84: tower
85: chandelier
86: awning
87: streetlight
88: booth
89: television receiver
90: airplane
91: dirt track
92: apparel
93: pole
94: land
95: bannister
96: escalator
97: ottoman
98: bottle
99: buffet
100: poster
101: stage
102: van
103: ship
104: fountain
105: conveyor belt
106: canopy
107: washer
108: plaything
109: swimming pool
110: stool
111: barrel
112: basket
113: waterfall
114: tent
115: bag
116: minibike
117: cradle
118: oven
119: ball
120: food
121: step
122: tank
123: trade name
124: microwave
125: pot
126: animal
127: bicycle
128: lake
129: dishwasher
130: screen
131: blanket
132: sculpture
133: hood
134: sconce
135: vase
136: traffic light
137: tray
138: ashcan
139: fan
140: pier
141: crt screen
142: plate
143: monitor
144: bulletin board
145: shower
146: radiator
147: glass
148: clock
149: flag
# Map source label IDs to train IDs; ignore_label is converted to 255.
label_mapping:
0: ignore_label
1: 0
2: 1
3: 2
4: 3
5: 4
6: 5
7: 6
8: 7
9: 8
10: 9
11: 10
12: 11
13: 12
14: 13
15: 14
16: 15
17: 16
18: 17
19: 18
20: 19
21: 20
22: 21
23: 22
24: 23
25: 24
26: 25
27: 26
28: 27
29: 28
30: 29
31: 30
32: 31
33: 32
34: 33
35: 34
36: 35
37: 36
38: 37
39: 38
40: 39
41: 40
42: 41
43: 42
44: 43
45: 44
46: 45
47: 46
48: 47
49: 48
50: 49
51: 50
52: 51
53: 52
54: 53
55: 54
56: 55
57: 56
58: 57
59: 58
60: 59
61: 60
62: 61
63: 62
64: 63
65: 64
66: 65
67: 66
68: 67
69: 68
70: 69
71: 70
72: 71
73: 72
74: 73
75: 74
76: 75
77: 76
78: 77
79: 78
80: 79
81: 80
82: 81
83: 82
84: 83
85: 84
86: 85
87: 86
88: 87
89: 88
90: 89
91: 90
92: 91
93: 92
94: 93
95: 94
96: 95
97: 96
98: 97
99: 98
100: 99
101: 100
102: 101
103: 102
104: 103
105: 104
106: 105
107: 106
108: 107
109: 108
110: 109
111: 110
112: 111
113: 112
114: 113
115: 114
116: 115
117: 116
118: 117
119: 118
120: 119
121: 120
122: 121
123: 122
124: 123
125: 124
126: 125
127: 126
128: 127
129: 128
130: 129
131: 130
132: 131
133: 132
134: 133
135: 134
136: 135
137: 136
138: 137
139: 138
140: 139
141: 140
142: 141
143: 142
144: 143
145: 144
146: 145
147: 146
148: 147
149: 148
150: 149
# Download URL (manual): https://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip使用方法#
要在 ADE20K 数据集上训练 YOLO26n-sem 模型 100 个周期,并将图像尺寸设为 512,你可以使用以下代码片段。有关可用参数的完整列表,请参阅模型的训练页面。
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="ade20k.yaml", epochs=100, imgsz=512)引用、许可证和致谢#
ADE20K 图像仅发布用于非商业研究和教育用途;该数据集的标注软件则根据 BSD-3 单独授权。商业使用需要获得 MIT CSAIL 的许可。
如果你在研究或开发工作中使用 ADE20K 数据集,请引用以下论文:
@inproceedings{zhou2017scene,
title={Scene Parsing through ADE20K Dataset},
author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
year={2017}
}我们谨此感谢 MIT CSAIL 计算机视觉组为计算机视觉社区创建并维护这一宝贵资源。有关 ADE20K 数据集及其创建者的更多信息,请访问 ADE20K 数据集网站。
常见问题#
要在 ADE20K 数据集上训练 YOLO26n-sem 模型 100 个周期,并将图像尺寸设为 512,你可以使用以下代码片段。有关可用参数的详细列表,请参阅模型的训练页面。
训练示例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="ade20k.yaml", epochs=100, imgsz=512)ADE20K 数据集遵循官方的 ADEChallengeData2016 目录结构,图像分别组织在
images/training/和images/validation/下,对应的掩码分别位于annotations/training/和annotations/validation/下。Ultralytics YAML 文件通过masks_dir: annotations字段将每张图像与其掩码配对,并使用label_mapping将源标签 ID1–150转换为连续的训练 ID0–149,同时将忽略标签映射到255。需要。下载
ADEChallengeData2016.zip压缩包(约 ~1 GB),并在训练前将其直接解压到你的datasets/文件夹中——压缩包自身的顶层文件夹已经命名为ADEChallengeData2016/,因此将其解压到该位置(而不是解压到你自行创建的单独ADEChallengeData2016文件夹)会生成ade20k.yaml所需的images/和annotations/目录结构。ADE20K 标注掩码存储源标签 ID,其中
0表示忽略或背景类别。label_mapping部分会将有效标签1到150映射为连续的训练 ID0到149,并将255分配给忽略像素,使其在训练和验证期间从损失和指标计算中排除。不可以。ADE20K 图像依据限制其用途仅为非商业研究和教育的条款发布;随附的标注软件则根据 BSD-3 单独授权。有关商业许可选项,请联系 MIT CSAIL。



