环境准备
git clone https://github.com/OpenDriveLab/OpenLane-V2.git
cd OpenLane-V2
conda create -n openlanev2 python=3.8 -y
conda activate openlanev2
pip install -r requirements.txt
python setup.py develop
下载数据:
- 下载 subset_A 的 OpenLane-V2 (info 信息,OpenLane-V2_subset_A_info.tar,包含OpenLane 拓扑初始任务的注释)
- 下载 subset_A 的 Map Element Bucket 信息 (OpenLane-V2_subset_A_info-ls.tar,包含驾驶场景拓扑任务的注释)
- 下载 subset_A 的 image 信息 (OpenLane-V2_subset_A_image_0-8.tar,用作传感器输入)
- 下载 subset_A 的 SDMap(OpenLane-V2_subset_A_sdmap.tar,用作传感器输入)
数据预处理
数据集被预处理为代表不同集合的pickle文件,然后用于训练模型或评估:
cd data
python OpenLane-V2/preprocess.py
对于使用SD地图和Map元素桶,请分别指定with_sd_map参数并运行python OpenLane-V2/preprocess-ls.py。
文件层级
OpenLane-V2/ 文件夹的层次结构描述如下:
└── OpenLane-V2
├── train
| ├── [segment_id]
| | ├── image (Image)
| | | ├── [camera]
| | | | ├── [timestamp].jpg
| | | | └── ...
| | | └── ...
| | ├── sdmap.json (SD Map)
| | └── info
| | ├── [timestamp].json (OpenLane-V2)
| | ├── [timestamp]-ls.json (Map Element Bucket)
| | └── ...
| └── ...
├── val
| └── ...
├── test
| └── ...
├── data_dict_example.json
├── data_dict_subset_A.json
├── data_dict_subset_B.json
├── openlanev2.md5
├── preprocess.py
└── preprocess-ls.py
- [segment_id] 指定帧序列,[camera] 是 7 个不同相机, [timestamp] 指定序列中的单个帧。
- image/ 包含各种相机捕获的图像, info/ 包含单个帧的元数据和注释。
- data_dict_[xxx].json 记录了数据子集下 train / val / test 的分割。
SD Map 标清地图
sdmap.json 包含三种类型(road、cross_walk、side_walk)的 SD 地图元素,可用作传感器输入。
[
{
'points': <list> -- list of 2D points in the BEV space
(BEV视角下各个类型地图元素的点集合)
'category': <str> -- type of the SD map element
'road',
'cross_walk',
'side_walk',
},
...
]
举例如下
{
"points": [[1456.7176083646482, 338.2536709289998], [1462.1868340333458, 322.7181386463344], [1464.83115775208, 315.43226608633995]], "category": "road"},
Meta Data 元数据
info/ 文件夹下的 json 文件包含每个帧的元数据和注释。每个文件的格式如下:
train 和 val 有 annotation 部分,test 没有 annotation 字段。
{
'version': <str> -- version
'segment_id': <str> -- segment_id(帧序列)
'meta_data': {
'source': <str> -- name of the original dataset
'source_id': <str> -- original identifier of the segment
}
'timestamp': <int> -- timestamp of the frame(序列中的单个帧)
'sensor': {
[camera]: {
<str> -- name of the camera
'image_path': <str> -- image path
'extrinsic': <dict> -- extrinsic parameters of the camera, trasformation from camera frame to vehicle frame
'intrinsic': <dict> -- intrinsic parameters of the camera
},
...
}
'pose': <dict> -- ego pose
'annotation': <dict> -- anntations for the current frame
}
Annotations 注释
对于 单个帧,上面 json 文件中的注释的格式如下:
{
'lane_centerline': [ (n lane centerlines in the current frame)
(当前帧中的n条车道中心线)
{
'id': <int> -- unique ID in the current frame(当前帧中,车道中心线唯一ID)
'points': <float> [n, 3] -- 3D coordiate(3D坐标)
'confidence': <float> -- confidence, only for prediction
(仅用于预测的置信度)
"is_intersection_or_connector": true/false 是否为交叉口或连接线
},