一. 项目数据集介绍:
1. COCO数据集:
coco2017,有80个类别,包含交通信号灯和交通标志, 红绿灯信号灯没有颜色属性标签.
COCO数据集JSON文件格式,主要有以下五个键字段:
<class ‘dict’>:
{
"info": info, # dict
"licenses": [license], # list ,内部是dict
"images": [image], # list ,内部是dict
"annotations": [annotation], # list ,内部是dict
"categories": # list ,内部是dict
}
其中要关注的是后三项内容,即 “images”, “annotations”,“categories”.
一组实例如下:
dict{
"images":[
{ "license":3,
"file_name":"COCO_val2014_000000391895.jpg",
"coco_url":"http:\/\/mscoco.org\/images\/391895",
"height":360,
"width":640,
"date_captured":"2013-11-14 11:18:45",
"flickr_url":"http:\/\/farm9.staticflickr.com\/8186\/8119368305_4e622c8349_z.jpg",
"id":391895
},
{...}, ...
]
"annotation":[
{ "segmentation": [[510.66,423.01,511.72,420.03,510.45......]], //见下面
"area": 702.1057499999998,
"iscrowd": 0, //见下面
"image_id": 289343,
"bbox": [473.07,395.93,38.65,28.67], //矩形框左上角的坐标和矩形框的长宽
"category_id": 18, //类别id
"id": 1768
},
{...}, ...
]
"categories":[{"supercategory": “person”, "id": 1, "name": “person”},
{"supercategory": “vehicle”, "id": 2, "name": “bicycle”},
...
{"supercategory": “indoor”, "id": 90, "name": “toothbrush”}
]
}
2. BDD100K数据集
BDD100K的道路目标检测部分总共有10类:bus,traffic light,traffic sign,person,bike,truck,moter,car,train,rider
。有目标的属性标签,比如交通信号灯有green, yellow, red, none
的 attributes 标签.
各类对象数目统计分布如下:
打开一张图片 images/100k/val/b1d9e136-9ab25cb3.jpg
, 如下:
并打开labels/100k/val/b1d9e136-9ab25cb3,json
查看其内容,如下:
{
"name": "b1d9e136-9ab25cb3",
"frames": [
{
"timestamp": 10000, //表示在时间点为10000下的图片
"objects": [
{
"category": "traffic sign", //存在一个traffic sign类别的对象
"id": 0,
"attributes": {
"occluded": false,
"truncated": false,
"trafficLightColor": "none" //交通标志的颜色
},
"box2d": { //左上角和右下角的四个坐标值
"x1": 373.484793,
"y1": 218.719691,
"x2": 418.816665,
"y2": 234.533134
}
},
{
"category": "person", //存在一个person类别的对象
"id": 1,
"attributes": {
"occluded": false,
"truncated": false,
"trafficLightColor": "none"
},
"box2d": {
"x1": 887.948822,
"y1": 329.413797,
"x2": 903.762266,
"y2": 369.474519
}
},
...
...
]
...
...
}