Link to this sectionADE20K 数据集#
ADE20K 数据集是由 MIT CSAIL 发布的大规模语义分割和场景解析基准。它提供了涵盖各种室内、室外、物体和背景类别的密集标注图像,使其成为研究人员和开发人员使用 Ultralytics YOLO 模型进行密集场景理解任务的重要资源。
Link to this section主要特性#
- ADE20K 包含 20,210 张训练图像、2,000 张验证图像和 3,352 张测试图像。
- 该数据集涵盖了 150 个语义类别,跨越了室内、室外、物体和背景类别。
- 标注是适用于密集场景解析的像素级分割掩码。
Link to this section数据集结构#
Ultralytics 配置要求采用官方的 ADEChallengeData2016 布局:
ADEChallengeData2016/
├── images/
│ ├── training/
│ └── validation/
└── annotations/
├── training/
└── validation/masks_dir 字段设置为 annotations,因此 images/ 下的每张图像都与 annotations/ 下的对应掩码配对。原始 ADE20K 掩码使用源标签 ID,其中 0 被忽略,label_mapping 部分将有效的 1 到 150 标签转换为连续的训练 ID 0 到 149,并将忽略的像素映射为 255。
Link to this section应用#
ADE20K 被广泛用于训练和评估语义分割和场景解析中的深度学习模型。其多样的类别集和复杂的场景使其在自动导航、机器人、增强现实和图像编辑等应用中极具价值。
室内和室外场景的广度也使 ADE20K 成为评估模型跨域泛化能力的有力基准。
Link to this section数据集 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): http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zipLink to this section使用方法#
若要使用图像尺寸 512 训练 YOLO26n-sem 模型并在 ADE20K 数据集上进行 100 个 epoch 的训练,你可以使用以下代码片段。有关可用参数的完整列表,请参阅模型训练页面。
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)Link to this section引用与致谢#
如果你在研究或开发工作中使用 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 数据集网站。
Link to this section常见问题#
Link to this section什么是 ADE20K 数据集,为什么它对计算机视觉很重要?#
ADE20K 数据集是一个用于语义分割的大规模场景解析基准。它包含 25,562 张密集标注的图像,涵盖了室内、室外、物体和背景类别的 150 个类别。研究人员使用 ADE20K 是因为它拥有多样的场景、细粒度的类别集以及诸如平均交并比 (mIoU) 等标准化评估指标,这使其成为基准测试密集预测模型的理想选择。
Link to this section如何使用 ADE20K 数据集训练 YOLO 模型?#
若要使用图像尺寸 512 训练 YOLO26n-sem 模型并在 ADE20K 数据集上进行 100 个 epoch 的训练,你可以使用以下代码片段。有关可用参数的详细列表,请参阅模型训练页面。
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)Link to this sectionADE20K 数据集的结构是怎样的?#
ADE20K 数据集遵循官方 ADEChallengeData2016 布局,图像组织在 images/training/ 和 images/validation/ 下,相应的掩码位于 annotations/training/ 和 annotations/validation/ 下。Ultralytics YAML 文件通过 masks_dir: annotations 字段将每张图像与其掩码配对,并使用 label_mapping 将源标签 ID 1–150 转换为连续的训练 ID 0–149,并将忽略标签映射为 255。
Link to this section为什么 ADE20K 使用 label_mapping?#
ADE20K 标注掩码存储源标签 ID,其中 0 表示忽略或背景类。label_mapping 部分将有效的 1 到 150 标签映射为连续的训练 ID 0 到 149,并将 255 分配给忽略的像素,以便在训练和验证期间将其从损失函数和评估指标中排除。