(一)使用YOLOv3訓練BDD100K數據集之數據集下載

目錄

1 數據集下載

之前博客寫 了如何使用YOLOv3訓練自動駕駛數據集KITTI,它的圖片尺寸普遍爲1242x375(大約),且總共有提供標籤的7481張訓練集,還有未提供標籤的7518張測試集,用於官方評測算法。如果我們自己要評測算法,需要從7481張訓練集中劃分一部分作爲驗證集,這樣訓練的數據又減少了。而BDD00K數據集總共擁有110k張圖片,分爲100k和10k兩個部分。其中100k的部分提供有70k的帶標籤訓練集數據10k帶標籤的驗證集數據,此外還有20k未提供標籤的數據用於官方評測算法。10k的部分只提供了圖片,目前沒有提供標籤。數據集下載可以去官方網址但是需要用教育郵箱註冊賬號,而且經常會出現下載到一半被禁止下載的提示,比較麻煩。這裏找到了一個很好的下載地址,不需要賬號,且不會出現下載中斷的問題!
地址如下:

  • BDD00K所有數據(包括可行駛區域,分割,原始圖片,對象檢測標籤)的下載地址:

https://archive.org/details/bdd100k

  • BDD00K所有圖片的下載地址:

https://archive.org/download/bdd100k/bdd100k_labels.zip

  • BDD00K所有圖片標籤的下載地址:

https://archive.org/download/bdd100k/bdd100k_images.zip

這裏,我只用到了bdd100k_labels.zipbdd100k_images.zip,但是我把bdd100k_drivable_maps.zipbdd100k_seg.zip也下載了,以防後面使用,如下:
在這裏插入圖片描述

2 數據集簡單分析

解壓bdd100k_labels.zipbdd100k_images.zip,會出現兩個bdd100k文件夾,這兩個文件夾內分別存儲了imageslabels兩個子文件夾,其中images文件夾內存放了1280x720的圖片,labels存放了json格式的標籤文件,我們把兩個子文件夾合併到一個bdd100k文件夾內,方便查看和處理。文件目錄樹如下:

├── bdd100k
│   ├── images
│   │   ├── 100k
│   │   │   ├── test    # 20k測試集圖片
│   │   │   ├── train   # 70k訓練集圖片
│   │   │   └── val     # 10k驗證集圖片
│   │   └── 10k
│   │   ├── test    # 2k測試集圖片
│   │   ├── train    # 7k測試集圖片
│   │   └── val    # 1k驗證集圖片
│   ├── labels
│   │   └── 100k 
│   │   ├── train  # 70k訓練集標籤
│   │   ├── val     # 10k驗證集標籤,這裏沒有提供20k測試集標籤
  • 常見的自動駕駛數據集比較
    在這裏插入圖片描述

  • 道路目標檢測各類物體數量分佈
    BDD100K的道路目標檢測部分總共有10類:bus,traffic light,traffic sign,person,bike,truck,moter,car,train,rider。各類對象數目統計分佈如下:
    在這裏插入圖片描述

3 標籤文件分析

隨便查看一張圖片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
                    }
                },
                {
                    "category": "person",	//存在一個person類別的對象
                    "id": 2,
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 355.562892,
                        "y1": 309.383434,
                        "x2": 368.213647,
                        "y2": 326.251107
                    }
                },
                {
                    "category": "person",	//存在一個person類別的對象
                    "id": 3,	
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 258.573769,
                        "y1": 295.678449,
                        "x2": 282.82105,
                        "y2": 347.335698
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 4,
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 786.742784,
                        "y1": 336.793403,
                        "x2": 806.773146,
                        "y2": 368.420289
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 5,
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 744.573602,
                        "y1": 331.522255,
                        "x2": 797.285079,
                        "y2": 378.962585
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 6,
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 718.217861,
                        "y1": 316.763042,
                        "x2": 755.115896,
                        "y2": 378.962586
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 7,
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 459.931618,
                        "y1": 317.81727,
                        "x2": 506.31772,
                        "y2": 362.094912
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 8,
                    "attributes": {
                        "occluded": true,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 348.183284,
                        "y1": 319.92573,
                        "x2": 375.593253,
                        "y2": 368.420289
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 9,
                    "attributes": {
                        "occluded": false,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 365.050957,
                        "y1": 299.895368,
                        "x2": 484.178899,
                        "y2": 390.559112
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 10,
                    "attributes": {
                        "occluded": false,
                        "truncated": false,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 467.311224,
                        "y1": 274.593858,
                        "x2": 751.953209,
                        "y2": 523.392035
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 11,
                    "attributes": {
                        "occluded": false,
                        "truncated": true,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 1.341755,
                        "y1": 296.732679,
                        "x2": 323.936004,
                        "y2": 521.283577
                    }
                },
                {
                    "category": "car",	//存在一個car類別的對象
                    "id": 12,	
                    "attributes": {
                        "occluded": false,
                        "truncated": true,
                        "trafficLightColor": "none"
                    },
                    "box2d": {
                        "x1": 872.135381,
                        "y1": 236.641594,
                        "x2": 1278.013765,
                        "y2": 684.68916
                    }
                },
            //道路可行駛區域的標籤
                {
                    "category": "area/drivable",
                    "id": 13,
                    "attributes": {},
                    "poly2d": [
                        [
                            379.295348,
                            522.084962,
                            "L"
                        ],
                        [
                            833.816375,
                            531.298227,
                            "L"
                        ],
                        [
                            978.157509,
                            649.535114,
                            "L"
                        ],
                        [
                            760.110261,
                            631.108585,
                            "C"
                        ],
                        [
                            499.06778,
                            611.146514,
                            "C"
                        ],
                        [
                            257.987372,
                            628.037498,
                            "C"
                        ],
                        [
                            379.295348,
                            522.084962,
                            "L"
                        ]
                    ]
                },
            //可選擇的行駛區域的標籤
                {
                    "category": "area/alternative",
                    "id": 14,
                    "attributes": {},
                    "poly2d": [
                        [
                            763.318996,
                            386.437234,
                            "L"
                        ],
                        [
                            755.503629,
                            448.378849,
                            "L"
                        ],
                        [
                            873.740518,
                            532.83377,
                            "L"
                        ],
                        [
                            866.256426,
                            421.87471,
                            "L"
                        ],
                        [
                            763.318996,
                            386.437234,
                            "L"
                        ]
                    ]
                },
                {
                    "category": "area/alternative",
                    "id": 15,
                    "attributes": {},
                    "poly2d": [
                        [
                            810.568964,
                            374.624742,
                            "L"
                        ],
                        [
                            867.943924,
                            388.124733,
                            "L"
                        ],
                        [
                            871.318922,
                            415.124715,
                            "L"
                        ],
                        [
                            776.818987,
                            381.374738,
                            "L"
                        ],
                        [
                            810.568964,
                            374.624742,
                            "L"
                        ]
                    ]
                },
            //單一的白色車道線
                {
                    "category": "lane/single white",
                    "id": 16,
                    "attributes": {
                        "direction": "parallel",
                        "style": "dashed"
                    },
                    "poly2d": [
                        [
                            472.553479,
                            437.976395,
                            "L"
                        ],
                        [
                            429.011966,
                            468.711581,
                            "L"
                        ],
                        [
                            234.355791,
                            627.51004,
                            "L"
                        ]
                    ]
                },
             //單一的白色車道線
                {
                    "category": "lane/single white",
                    "id": 17,
                    "attributes": {
                        "direction": "parallel",
                        "style": "dashed"
                    },
                    "poly2d": [
                        [
                            476.395377,
                            423.889435,
                            "L"
                        ],
                        [
                            412.363741,
                            464.869683,
                            "L"
                        ],
                        [
                            210.023769,
                            627.51004,
                            "L"
                        ]
                    ]
                },
             //單一的白色車道線
                {
                    "category": "lane/single white",
                    "id": 18,
                    "attributes": {
                        "direction": "parallel",
                        "style": "solid"
                    },
                    "poly2d": [
                        [
                            749.17015,
                            462.308417,
                            "L"
                        ],
                        [
                            984.806573,
                            654.403328,
                            "L"
                        ]
                    ]
                },
             //單一的白色車道線
                {
                    "category": "lane/single white",
                    "id": 19,
                    "attributes": {
                        "direction": "parallel",
                        "style": "solid"
                    },
                    "poly2d": [
                        [
                            750.450783,
                            441.818294,
                            "L"
                        ],
                        [
                            1046.276945,
                            659.525859,
                            "L"
                        ]
                    ]
                },
             //單一的白色車道線
                {
                    "category": "lane/single white",
                    "id": 20,
                    "attributes": {
                        "direction": "parallel",
                        "style": "dashed"
                    },
                    "poly2d": [
                        [
                            749.17015,
                            380.347922,
                            "L"
                        ],
                        [
                            874.672158,
                            414.925006,
                            "L"
                        ]
                    ]
                },
             //單一的白色車道線
                {
                    "category": "lane/single white",
                    "id": 21,
                    "attributes": {
                        "direction": "parallel",
                        "style": "dashed"
                    },
                    "poly2d": [
                        [
                            795.272928,
                            371.383493,
                            "L"
                        ],
                        [
                            877.233423,
                            390.592984,
                            "L"
                        ]
                    ]
                },
             //道路路邊的車道線
                {
                    "category": "lane/road curb",
                    "id": 22,
                    "attributes": {
                        "direction": "parallel",
                        "style": "solid"
                    },
                    "poly2d": [
                        [
                            829.850012,
                            371.383493,
                            "L"
                        ],
                        [
                            882.355954,
                            380.347922,
                            "L"
                        ]
                    ]
                },
             //道路路邊的車道線
                {
                    "category": "lane/road curb",
                    "id": 23,
                    "attributes": {
                        "direction": "parallel",
                        "style": "solid"
                    },
                    "poly2d": [
                        [
                            307.351856,
                            366.260962,
                            "L"
                        ],
                        [
                            352.174002,
                            361.138431,
                            "L"
                        ]
                    ]
                }
            ]
        }
    ],
    "attributes": {
        "weather": "undefined",
        "scene": "city street",
        "timeofday": "daytime"
    }
}
```
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章