Commit 41b18fd8 authored by zhe chen's avatar zhe chen
Browse files

Use pre-commit to reformat code


Use pre-commit to reformat code
parent ff20ea39
......@@ -3,13 +3,13 @@
# ---------------------------------------------
# Modified by Xiaoyu Tian
# ---------------------------------------------
from data_converter.create_gt_database import create_groundtruth_database
import argparse
import sys
from os import path as osp
from data_converter import nuscenes_converter as nuscenes_converter
from data_converter import nuscenes_occ_converter as occ_converter
import argparse
from os import path as osp
import sys
sys.path.append('.')
......@@ -76,28 +76,7 @@ def occ_nuscenes_data_prep(root_path,
max_sweeps (int): Number of input consecutive frames. Default: 10
"""
occ_converter.create_nuscenes_occ_infos(
root_path, occ_path,out_dir, can_bus_root_path, info_prefix, version=version, max_sweeps=max_sweeps)
# if version == 'v1.0-test':
# info_test_path = osp.join(
# out_dir, f'{info_prefix}_infos_temporal_test.pkl')
# nuscenes_converter.export_2d_annotation(
# root_path, info_test_path, version=version)
# else:
# info_train_path = osp.join(
# out_dir, f'{info_prefix}_infos_temporal_train.pkl')
# info_val_path = osp.join(
# out_dir, f'{info_prefix}_infos_temporal_val.pkl')
# nuscenes_converter.export_2d_annotation(
# root_path, info_train_path, version=version)
# nuscenes_converter.export_2d_annotation(
# root_path, info_val_path, version=version)
# create_groundtruth_database(dataset_name, root_path, info_prefix,
# f'{out_dir}/{info_prefix}_infos_train.pkl')
root_path, occ_path, out_dir, can_bus_root_path, info_prefix, version=version, max_sweeps=max_sweeps)
parser = argparse.ArgumentParser(description='Data converter arg parser')
......@@ -161,7 +140,6 @@ if __name__ == '__main__':
out_dir=args.out_dir,
max_sweeps=args.max_sweeps)
elif args.dataset == 'nuscenes' and args.version == 'v1.0-mini':
train_version = f'{args.version}'
nuscenes_data_prep(
......@@ -203,4 +181,3 @@ if __name__ == '__main__':
dataset_name='NuScenesDataset',
out_dir=args.out_dir,
max_sweeps=args.max_sweeps)
# Copyright (c) OpenMMLab. All rights reserved.
import pickle
from os import path as osp
import mmcv
import numpy as np
import pickle
from mmcv import track_iter_progress
from mmcv.ops import roi_align
from os import path as osp
from pycocotools import mask as maskUtils
from pycocotools.coco import COCO
from mmdet3d.core.bbox import box_np_ops as box_np_ops
from mmdet3d.datasets import build_dataset
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
from pycocotools import mask as maskUtils
from pycocotools.coco import COCO
def _poly2mask(mask_ann, img_h, img_w):
......
......@@ -3,19 +3,19 @@
# ---------------------------------------------
# Modified by Xiaoyu Tian
# ---------------------------------------------
import mmcv
import numpy as np
import os
from collections import OrderedDict
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.geometry_utils import view_points
from os import path as osp
from pyquaternion import Quaternion
from shapely.geometry import MultiPoint, box
from typing import List, Tuple, Union
import mmcv
import numpy as np
from mmdet3d.core.bbox.box_np_ops import points_cam2img
from mmdet3d.datasets import NuScenesDataset
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.geometry_utils import view_points
from pyquaternion import Quaternion
from shapely.geometry import MultiPoint, box
nus_categories = ('car', 'truck', 'trailer', 'bus', 'construction_vehicle',
'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone',
......@@ -45,8 +45,8 @@ def create_nuscenes_infos(root_path,
max_sweeps (int): Max number of sweeps.
Default: 10
"""
from nuscenes.nuscenes import NuScenes
from nuscenes.can_bus.can_bus_api import NuScenesCanBus
from nuscenes.nuscenes import NuScenes
print(version, root_path)
nusc = NuScenes(version=version, dataroot=root_path, verbose=True)
nusc_can_bus = NuScenesCanBus(dataroot=can_bus_root_path)
......
......@@ -3,20 +3,20 @@
# ---------------------------------------------
# Modified by Xiaoyu Tian
# ---------------------------------------------
import mmcv
import numpy as np
import os
from collections import OrderedDict
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.geometry_utils import view_points
from os import path as osp
from pyquaternion import Quaternion
from shapely.geometry import MultiPoint, box
from typing import List, Tuple, Union
import mmcv
import numpy as np
import simplejson as json
from mmdet3d.core.bbox.box_np_ops import points_cam2img
from mmdet3d.datasets import NuScenesDataset
import simplejson as json
from nuscenes.nuscenes import NuScenes
from nuscenes.utils.geometry_utils import view_points
from pyquaternion import Quaternion
from shapely.geometry import MultiPoint, box
nus_categories = ('car', 'truck', 'trailer', 'bus', 'construction_vehicle',
'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone',
......@@ -48,8 +48,8 @@ def create_nuscenes_occ_infos(root_path,
Default: 10
"""
from nuscenes.nuscenes import NuScenes
from nuscenes.can_bus.can_bus_api import NuScenesCanBus
from nuscenes.nuscenes import NuScenes
print(version, root_path)
nusc = NuScenes(version=version, dataroot=root_path, verbose=True)
nusc_can_bus = NuScenesCanBus(dataroot=can_bus_root_path)
......@@ -58,7 +58,7 @@ def create_nuscenes_occ_infos(root_path,
available_vers = ['v1.0-trainval', 'v1.0-test', 'v1.0-mini']
assert version in available_vers
with open(os.path.join(occ_path,'annotations.json'),'r') as f:
with open(os.path.join(occ_path, 'annotations.json'), 'r') as f:
occ_anno = json.load(f)
if version == 'v1.0-trainval':
......@@ -89,8 +89,7 @@ def create_nuscenes_occ_infos(root_path,
])
token2name = dict()
for scene in nusc.scene:
token2name[scene['token']]=scene['name']
token2name[scene['token']] = scene['name']
test = 'test' in version
if test:
......@@ -100,7 +99,7 @@ def create_nuscenes_occ_infos(root_path,
len(train_scenes), len(val_scenes)))
train_nusc_infos, val_nusc_infos = _fill_occ_trainval_infos(
nusc,occ_anno,token2name, nusc_can_bus, train_scenes, val_scenes, test, max_sweeps=max_sweeps)
nusc, occ_anno, token2name, nusc_can_bus, train_scenes, val_scenes, test, max_sweeps=max_sweeps)
metadata = dict(version=version)
if test:
......@@ -213,20 +212,18 @@ def _fill_occ_trainval_infos(nusc,
train_nusc_infos = []
val_nusc_infos = []
frame_idx = 0
scene_infos=occ_anno['scene_infos']
scene_infos = occ_anno['scene_infos']
for sample in mmcv.track_iter_progress(nusc.sample):
lidar_token = sample['data']['LIDAR_TOP']
sd_rec = nusc.get('sample_data', sample['data']['LIDAR_TOP'])
scene_token = sample['scene_token']
scene_name = token2name[scene_token]
sample_token=sd_rec['sample_token']
sample_token = sd_rec['sample_token']
if sample_token in scene_infos[scene_name].keys():
occ_sample=scene_infos[scene_name][sample_token]
occ_sample = scene_infos[scene_name][sample_token]
else:
continue
......
......@@ -3,26 +3,25 @@ from __future__ import division
import argparse
import copy
import mmcv
import os
import time
import torch
import warnings
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist, wrap_fp16_model
from os import path as osp
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist, wrap_fp16_model
from mmcv.utils import TORCH_VERSION, digit_version
from mmdet import __version__ as mmdet_version
from mmdet3d import __version__ as mmdet3d_version
#from mmdet3d.apis import train_model
from mmdet3d.datasets import build_dataset
from mmdet3d.models import build_model
from mmdet3d.utils import collect_env, get_root_logger
from mmdet.apis import set_random_seed
from mmseg import __version__ as mmseg_version
from mmcv.utils import TORCH_VERSION, digit_version
# from mmdet3d.apis import train_model
def parse_args():
parser = argparse.ArgumentParser(description='Train a detector')
......@@ -128,7 +127,8 @@ def main():
print(_module_path)
plg_lib = importlib.import_module(_module_path)
from projects.mmdet3d_plugin.bevformer.apis import custom_train_model
from projects.mmdet3d_plugin.bevformer.apis import \
custom_train_model
# set cudnn_benchmark
if cfg.get('cudnn_benchmark', False):
torch.backends.cudnn.benchmark = True
......@@ -141,7 +141,7 @@ def main():
# use config filename as default work_dir if cfg.work_dir is None
cfg.work_dir = osp.join('./work_dirs',
osp.splitext(osp.basename(args.config))[0])
#if args.resume_from is not None:
# if args.resume_from is not None:
if args.resume_from is not None and osp.isfile(args.resume_from):
cfg.resume_from = args.resume_from
......@@ -225,7 +225,7 @@ def main():
if fp16_cfg is not None:
wrap_fp16_model(eval_model)
#eval_model.init_weights()
# eval_model.init_weights()
eval_model.load_state_dict(model.state_dict())
logger.info(f'Model:\n{model}')
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import numpy as np
import warnings
from mmcv import Config, DictAction, mkdir_or_exist, track_iter_progress
from os import path as osp
import numpy as np
from mmcv import Config, DictAction, mkdir_or_exist, track_iter_progress
from mmdet3d.core.bbox import (Box3DMode, CameraInstance3DBoxes, Coord3DMode,
DepthInstance3DBoxes, LiDARInstance3DBoxes)
from mmdet3d.core.visualizer import (show_multi_modality_result, show_result,
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import torch
from mmcv.runner import save_checkpoint
from torch import nn as nn
from mmdet.apis import init_model
from torch import nn as nn
def fuse_conv_bn(conv, bn):
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
from mmcv import Config, DictAction
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import mmcv
from mmcv import Config
from mmdet3d.datasets import build_dataset
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import tempfile
import torch
from mmcv import Config
from mmcv.runner import load_state_dict
from mmdet3d.models import build_detector
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import subprocess
import torch
......
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import torch
from collections import OrderedDict
import torch
def convert_stem(model_key, model_weight, state_dict, converted_names):
new_key = model_key.replace('stem.conv', 'conv1')
......
......@@ -4,24 +4,23 @@
# Modified by Xiaoyu Tian
# ---------------------------------------------
import argparse
import mmcv
import os
import sys
import torch
import os.path as osp
import time
import warnings
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.parallel import MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,
wrap_fp16_model)
from mmdet3d.datasets import build_dataset
from projects.mmdet3d_plugin.datasets.builder import build_dataloader
from mmdet3d.models import build_model
from mmdet.apis import set_random_seed
from projects.mmdet3d_plugin.bevformer.apis.test import custom_multi_gpu_test
from mmdet.datasets import replace_ImageToTensor
import time
import os.path as osp
from projects.mmdet3d_plugin.bevformer.apis.test import custom_multi_gpu_test
from projects.mmdet3d_plugin.datasets.builder import build_dataloader
def parse_args():
......@@ -193,7 +192,7 @@ def main():
# build the dataloader
dataset = build_dataset(cfg.data.test)
if args.eval_fscore:
dataset.eval_fscore=True
dataset.eval_fscore = True
data_loader = build_dataloader(
dataset,
samples_per_gpu=samples_per_gpu,
......@@ -242,7 +241,7 @@ def main():
if args.out:
print(f'\nwriting results to {args.out}')
assert False
#mmcv.dump(outputs['bbox_results'], args.out)
# mmcv.dump(outputs['bbox_results'], args.out)
kwargs = {} if args.eval_options is None else args.eval_options
kwargs['jsonfile_prefix'] = osp.join('test', args.config.split(
'/')[-1].split('.')[-2], time.ctime().replace(' ', '_').replace(':', '_'))
......@@ -254,12 +253,12 @@ def main():
# hard-code way to remove EvalHook args
for key in [
'interval', 'tmpdir', 'start', 'gpu_collect', 'save_best',
'rule','begin','end'
'rule', 'begin', 'end'
]:
eval_kwargs.pop(key, None)
eval_kwargs.update(dict(metric=args.eval, **kwargs))
dataset.evaluate_miou(outputs,show_dir=args.show_dir, **eval_kwargs)
dataset.evaluate_miou(outputs, show_dir=args.show_dir, **eval_kwargs)
if __name__ == '__main__':
......
......@@ -8,26 +8,25 @@ from __future__ import division
import argparse
import copy
import mmcv
import os
import time
import torch
import warnings
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist
from os import path as osp
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist
from mmcv.utils import TORCH_VERSION, digit_version
from mmdet import __version__ as mmdet_version
from mmdet3d import __version__ as mmdet3d_version
#from mmdet3d.apis import train_model
from mmdet3d.datasets import build_dataset
from mmdet3d.models import build_model
from mmdet3d.utils import collect_env, get_root_logger
from mmdet.apis import set_random_seed
from mmseg import __version__ as mmseg_version
from mmcv.utils import TORCH_VERSION, digit_version
# from mmdet3d.apis import train_model
def parse_args():
......@@ -134,7 +133,8 @@ def main():
print(_module_path)
plg_lib = importlib.import_module(_module_path)
from projects.mmdet3d_plugin.bevformer.apis.train import custom_train_model
from projects.mmdet3d_plugin.bevformer.apis.train import \
custom_train_model
# set cudnn_benchmark
if cfg.get('cudnn_benchmark', False):
torch.backends.cudnn.benchmark = True
......
import open3d as o3d
import pickle
import math
import numpy as np
import open3d as o3d
import torch
import math
from pathlib import Path
import os
from glob import glob
LINE_SEGMENTS = [
[4, 0], [3, 7], [5, 1], [6, 2], # lines along x-axis
[5, 4], [5, 6], [6, 7], [7, 4], # lines along x-axis
[0, 1], [1, 2], [2, 3], [3, 0]] # lines along y-axis
colors_map = np.array(
[
# [0, 0, 0, 255], # 0 undefined
......@@ -22,8 +20,8 @@ colors_map = np.array(
[255, 140, 0, 255], # 6 pole Darkorange
[233, 150, 70, 255], # 7 construction_cone Darksalmon
[255, 61, 99, 255], # 8 bycycle Red
[112, 128, 144, 255],# 9 motorcycle Slategrey
[222, 184, 135, 255],# 10 building Burlywood
[112, 128, 144, 255], # 9 motorcycle Slategrey
[222, 184, 135, 255], # 10 building Burlywood
[0, 175, 0, 255], # 11 vegetation Green
[165, 42, 42, 255], # 12 trunk nuTonomy green
[0, 207, 191, 255], # 13 curb, road, lane_marker, other_ground
......@@ -48,6 +46,7 @@ def voxel2points(voxel, voxelSize, range=[-40.0, -40.0, -1.0, 40.0, 40.0, 5.4],
occIdx[2][:, None] * voxelSize[2] + voxelSize[2] / 2 + range[2]), dim=1)
return points, voxel[occIdx]
def voxel_profile(voxel, voxel_size):
centers = torch.cat((voxel[:, :2], voxel[:, 2][:, None] - voxel_size[2] / 2), dim=1)
# centers = voxel
......@@ -57,6 +56,7 @@ def voxel_profile(voxel, voxel_size):
yaw = torch.full_like(centers[:, 0:1], 0)
return torch.cat((centers, wlh, yaw), dim=1)
def rotz(t):
"""Rotation about the z-axis."""
c = torch.cos(t)
......@@ -65,25 +65,27 @@ def rotz(t):
[s, c, 0],
[0, 0, 1]])
def my_compute_box_3d(center, size, heading_angle):
h, w, l = size[:, 2], size[:, 0], size[:, 1]
heading_angle = -heading_angle - math.pi / 2
center[:, 2] = center[:, 2] + h / 2
#R = rotz(1 * heading_angle)
# R = rotz(1 * heading_angle)
l, w, h = (l / 2).unsqueeze(1), (w / 2).unsqueeze(1), (h / 2).unsqueeze(1)
x_corners = torch.cat([-l, l, l, -l, -l, l, l, -l], dim=1)[..., None]
y_corners = torch.cat([w, w, -w, -w, w, w, -w, -w], dim=1)[..., None]
z_corners = torch.cat([h, h, h, h, -h, -h, -h, -h], dim=1)[..., None]
#corners_3d = R @ torch.vstack([x_corners, y_corners, z_corners])
# corners_3d = R @ torch.vstack([x_corners, y_corners, z_corners])
corners_3d = torch.cat([x_corners, y_corners, z_corners], dim=2)
corners_3d[..., 0] += center[:, 0:1]
corners_3d[..., 1] += center[:, 1:2]
corners_3d[..., 2] += center[:, 2:3]
return corners_3d
def generate_the_ego_car():
ego_range = [-2, -1, 0, 2, 1, 1.5]
ego_voxel_size=[0.1, 0.1, 0.1]
ego_voxel_size = [0.1, 0.1, 0.1]
ego_xdim = int((ego_range[3] - ego_range[0]) / ego_voxel_size[0])
ego_ydim = int((ego_range[4] - ego_range[1]) / ego_voxel_size[1])
ego_zdim = int((ego_range[5] - ego_range[2]) / ego_voxel_size[2])
......@@ -96,13 +98,16 @@ def generate_the_ego_car():
ego_point_y = (ego_xyz[:, 1:2] + 0.5) / ego_ydim * (ego_range[4] - ego_range[1]) + ego_range[1]
ego_point_z = (ego_xyz[:, 2:3] + 0.5) / ego_zdim * (ego_range[5] - ego_range[2]) + ego_range[2]
ego_point_xyz = np.concatenate((ego_point_y, ego_point_x, ego_point_z), axis=-1)
ego_points_label = (np.ones((ego_point_xyz.shape[0]))*16).astype(np.uint8)
ego_points_label = (np.ones((ego_point_xyz.shape[0])) * 16).astype(np.uint8)
ego_dict = {}
ego_dict['point'] = ego_point_xyz
ego_dict['label'] = ego_points_label
return ego_point_xyz
def show_point_cloud(points: np.ndarray, colors=True, points_colors=None, obj_bboxes=None, voxelize=False, bbox_corners=None, linesets=None, ego_pcd=None, scene_idx=0, frame_idx=0, large_voxel=True, voxel_size=0.4) -> None:
def show_point_cloud(points: np.ndarray, colors=True, points_colors=None, obj_bboxes=None, voxelize=False,
bbox_corners=None, linesets=None, ego_pcd=None, scene_idx=0, frame_idx=0, large_voxel=True,
voxel_size=0.4) -> None:
vis = o3d.visualization.VisualizerWithKeyCallback()
vis.create_window(str(scene_idx))
......@@ -136,13 +141,14 @@ def show_point_cloud(points: np.ndarray, colors=True, points_colors=None, obj_bb
vis.update_renderer()
return vis
def vis_nuscene():
voxelSize = [0.4, 0.4, 0.4]
point_cloud_range = [-40.0, -40.0, -1.0, 40.0, 40.0, 5.4]
ignore_labels = [17, 255]
vis_voxel_size = 0.4
file = "data/29796060110c4163b07f06eff4af0753/labels.npz"
file = 'data/29796060110c4163b07f06eff4af0753/labels.npz'
data = np.load(file)
semantics, mask_lidar, mask_camera = data['semantics'], data['mask_lidar'], data['mask_camera']
......@@ -158,11 +164,13 @@ def vis_nuscene():
ego_pcd.points = o3d.utility.Vector3dVector(ego_points)
bboxes_corners = my_compute_box_3d(bboxes[:, 0:3], bboxes[:, 3:6], bboxes[:, 6:7])
bases_ = torch.arange(0, bboxes_corners.shape[0] * 8, 8)
edges = torch.tensor([[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4], [0, 4], [1, 5], [2, 6], [3, 7]]) # lines along y-axis
edges = torch.tensor([[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4], [0, 4], [1, 5], [2, 6],
[3, 7]]) # lines along y-axis
edges = edges.reshape((1, 12, 2)).repeat(bboxes_corners.shape[0], 1, 1)
edges = edges + bases_[:, None, None]
vis = show_point_cloud(points=points, colors=True, points_colors=pcd_colors, voxelize=True, obj_bboxes=None,
bbox_corners=bboxes_corners.numpy(), linesets=edges.numpy(), ego_pcd=ego_pcd, large_voxel=True, voxel_size=vis_voxel_size)
bbox_corners=bboxes_corners.numpy(), linesets=edges.numpy(), ego_pcd=ego_pcd,
large_voxel=True, voxel_size=vis_voxel_size)
# control view
# view_control = vis.get_view_control()
......@@ -179,5 +187,6 @@ def vis_nuscene():
vis.destroy_window()
del vis
if __name__ == '__main__':
vis_nuscene()
<div id="top" align="center">
# OpenLane-Huawei
**全球首个自动驾驶道路结构感知和推理基准。**
<a href="#数据">
......@@ -15,12 +16,10 @@
**中文 | [English](./README.md)**
<img src="./imgs/poster.gif" width="696px">
</div>
## 目录
- [关键](#特色---我们为什么是独一无二的)
......@@ -38,6 +37,7 @@
- [许可说明](#许可说明)
## 特色 - 我们为什么是独一无二的?
### 三维场景,3D车道
道路环境需要怎样的建模才能满足车辆自动驾驶功能的需求?
......@@ -45,44 +45,41 @@
以往的数据集一般都在2D图像上标注车道,但在实际应用中,由于缺乏高度信息,2D车道数据无法支持车辆在上下坡、路面不平整等场景行驶,因此**3D车道**数据是不可或缺的。
同我们之前的工作 [OpenLane](https://github.com/OpenDriveLab/OpenLane) 一致,OpenLane-Huawei 提供三维车道标注。
### 关注交通要素,确保行车规范
在道路上平稳的行驶只是第一步,驾驶汽车还需要遵循环境中的**交通要素**(交通灯,路标)信息指示,确保不违反当地交通法规,因此 OpenLane-Huawei 也提供了2D交通要素标注。
交通要素在2D图像上尺寸大多都较小,检测领域中小目标检测一直是个热点,这也是该基准的挑战之一。
### 拓扑关系支撑场景结构化
环境中交通要素应仅对其特定的车道有指示作用,遵循错误的信号将造成灾难性的后果,因此需要明确车道与交通要素的关系。环境中的车道也不应是割裂存在的,车道与车道的关系也同样重要。
OpenLane-Huawei 提供车道与车道、车道与交通要素之间的拓扑关系,打造结构化场景。
自动驾驶汽车需要通过**推理**捕捉正确的**拓扑关系**以正确的方式行驶。
我们希望这个数据集的建立可以促进**道路场景感知和推理**任务的发展。
自动驾驶汽车需要通过**推理**捕捉正确的**拓扑关系**以正确的方式行驶。 我们希望这个数据集的建立可以促进**道路场景感知和推理**任务的发展。
### 多元大规模数据,搭建超赞数据集
对于机器学习任务,数据是必备的基石。
我们提供从奥斯汀到新加坡,从波士顿到迈阿密等各个城市收集的数据的标注,
支撑数据的**多元性**
<p align="right">(<a href="#top">回到顶部</a>)</p>
对于机器学习任务,数据是必备的基石。 我们提供从奥斯汀到新加坡,从波士顿到迈阿密等各个城市收集的数据的标注, 支撑数据的**多元性**
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 任务
数据集的首要任务是**场景结构感知和推理**,这需要模型能够识别周围环境中车道的可行驶状态。
该数据集的任务不仅包括车道中心线和交通要素检测,还包括检测到的对象的拓扑关系识别。
我们定义了[**OpenLane-V2 Score (OLS)**](./docs/metrics.md#openlane-v2-score),该指标为各个子任务指标的平均值:
数据集的首要任务是**场景结构感知和推理**,这需要模型能够识别周围环境中车道的可行驶状态。 该数据集的任务不仅包括车道中心线和交通要素检测,还包括检测到的对象的拓扑关系识别。 我们定义了[**OpenLane-V2 Score (
OLS)**](./docs/metrics.md#openlane-v2-score),该指标为各个子任务指标的平均值:
$$
\text{OLS} = \frac{1}{4} \bigg[ \text{DET}_{l} + \text{DET}_{t} + f(\text{TOP}_{ll}) + f(\text{TOP}_{lt}) \bigg].
$$
$$ \\text{OLS} = \\frac{1}{4} \\bigg\[ \\text{DET}_{l} + \\text{DET}_{t} + f(\\text{TOP}_{ll}) + f(\\text{TOP}_{lt})
\\bigg\]. $$
子任务的指标如下所述:
### 3D车道线检测 🛣️
[OpenLane](https://github.com/OpenDriveLab/OpenLane) 数据集是迄今为止第一个真实世界和规模最大的 3D 车道数据集,提供 3D 空间下的车道线标注。
在OpenLane基础上,我们将 3D 车道检测的任务定义如下:从覆盖整个水平 FOV(视场角-Field Of View) 的多视图中检测带方向的 3D 车道中心线。
用平均精度 $mAP_{LC}$ 指标评估车道中心线的检测性能。
[OpenLane](https://github.com/OpenDriveLab/OpenLane) 数据集是迄今为止第一个真实世界和规模最大的 3D 车道数据集,提供 3D 空间下的车道线标注。 在OpenLane基础上,我们将 3D
车道检测的任务定义如下:从覆盖整个水平 FOV(视场角-Field Of View) 的多视图中检测带方向的 3D 车道中心线。 用平均精度 $mAP\_{LC}$ 指标评估车道中心线的检测性能。
<p align="center">
<img src="./imgs/lane.gif" width="696px" >
......@@ -90,27 +87,18 @@ $$
### 交通标志检测 🚥
现有的数据集很少关注交通标志的检测及其语义,但是交通标志是自动驾驶汽车中关键信息。
该属性表示交通要素的语义,例如交通灯的红色。
在这个子任务中,在给定的前视图图像上,要求同时感知交通要素(交通灯和路标)的位置及其属性。
与典型的 2D 检测数据集相比,挑战在于由于室外环境的大规模,交通要素的尺寸很小。
与典型的多分类 2D 检测任务类似, $mAP_{TE}$ 用于衡量交通要素 (TE)综合的检测性能。
现有的数据集很少关注交通标志的检测及其语义,但是交通标志是自动驾驶汽车中关键信息。 该属性表示交通要素的语义,例如交通灯的红色。 在这个子任务中,在给定的前视图图像上,要求同时感知交通要素(交通灯和路标)的位置及其属性。 与典型的 2D
检测数据集相比,挑战在于由于室外环境的大规模,交通要素的尺寸很小。 与典型的多分类 2D 检测任务类似, $mAP\_{TE}$ 用于衡量交通要素 (TE)综合的检测性能。
<p align="center">
<img src="./imgs/traffic_element.gif" width="696px" >
</p>
### 拓扑认知 🕸️
我们首先定义在自动驾驶领域识别拓扑关系的任务。
给定多视图图像,该模型学习识别车道中心线之间以及车道中心线与交通要素之间的拓扑关系。
最相似的任务是图领域的连通性预测,其中顶点是给定的,模型只预测边。
在我们的例子中,模型的顶点和边都是未知的。
因此,首先需要检测车道中心线和交通要素,然后建立拓扑关系。
参照连通性预测任务,
我们用 $mAP_{LCLC}$ 评估车道中心线(LCLC)之间的拓扑表现,
用 $mAP_{LCTE}$ 评估车道中心线和交通要素(LCTE)之间的拓扑表现。
我们首先定义在自动驾驶领域识别拓扑关系的任务。 给定多视图图像,该模型学习识别车道中心线之间以及车道中心线与交通要素之间的拓扑关系。 最相似的任务是图领域的连通性预测,其中顶点是给定的,模型只预测边。
在我们的例子中,模型的顶点和边都是未知的。 因此,首先需要检测车道中心线和交通要素,然后建立拓扑关系。 参照连通性预测任务, 我们用 $mAP\_{LCLC}$ 评估车道中心线(LCLC)之间的拓扑表现, 用 $mAP\_{LCTE}$
评估车道中心线和交通要素(LCTE)之间的拓扑表现。
<p align="center">
<img src="./imgs/topology.gif" width="696px" >
......@@ -118,42 +106,37 @@ $$
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 信息发布
- [2023/02]
* 数据集 `v1.0`: `subset_A` 数据发布。
* 基模型发布。
- [2023/01]
* 数据集 `v0.1`: OpenLane-Huawei 数据集样本发布。
* 开发工具 `v0.1.0`: OpenLane-Huawei 开发工具发布。
<p align="right">(<a href="#top">回到顶部</a>)</p>
- \[2023/02\]
- 数据集 `v1.0`: `subset_A` 数据发布。
- 基模型发布。
- \[2023/01\]
- 数据集 `v0.1`: OpenLane-Huawei 数据集样本发布。
- 开发工具 `v0.1.0`: OpenLane-Huawei 开发工具发布。
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 数据
OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理的大规模数据集。
[OpenLane](https://github.com/OpenDriveLab/OpenLane) 数据集一致,我们提供三维空间中的车道真值。与之有区别的是,OpenLane-Huawei 提供的是车道中心线的3D标注,而OpenLane提供的是车道分割线3D标注。此外,我们还提供了交通标志(交通灯和路标)及其属性的2D框标注,和车道中心线之间以及车道中心线与交通要素之间的拓扑关系标注。
OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理的大规模数据集。 与 [OpenLane](https://github.com/OpenDriveLab/OpenLane)
数据集一致,我们提供三维空间中的车道真值。与之有区别的是,OpenLane-Huawei 提供的是车道中心线的3D标注,而OpenLane提供的是车道分割线3D标注。此外,我们还提供了交通标志(交通灯和路标)
及其属性的2D框标注,和车道中心线之间以及车道中心线与交通要素之间的拓扑关系标注。
数据集分为两个子集。
**`subset_A`作为主要子集,服务于即将到来的比赛和排行榜,比赛中不允许任何外部数据,包括本数据集其他子集**
`subset_B`可以用来测试模型的泛化能力。
更多信息请参考对应的页面:[使用数据](./data/README.md)[标注文档](./docs/annotation.md)[数据统计](./docs/statistics.md)
`subset_B`可以用来测试模型的泛化能力。 更多信息请参考对应的页面:[使用数据](./data/README.md)[标注文档](./docs/annotation.md)[数据统计](./docs/statistics.md)
现在就[下载](./data/README.md#download)我们的数据集来发现更多!
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 开发工具
我们提供了一个开发工具来方便社区熟悉并使用 OpenLane-Huawei 数据集。
可以通过 `openlanv2` 的API实现数据集的使用,例如加载图像、加载元数据和评估结果。
我们提供了一个开发工具来方便社区熟悉并使用 OpenLane-Huawei 数据集。 可以通过 `openlanv2` 的API实现数据集的使用,例如加载图像、加载元数据和评估结果。
更多开发工具信息请参考[开发工具](./docs/devkit.md)
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 入门指南
......@@ -177,9 +160,7 @@ OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理
- <img src="https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png" alt="Google Drive" width="18"/> Google Drive,
- <img src="https://nd-static.bdstatic.com/m-static/v20-main/favicon-main.ico" alt="百度云" width="18"/> 百度云。
并将它们移动至 `data/OpenLane-V2/` 文件夹下解压。
生成的目录结构应[如下](./data/README.md#hierarchy)所示。
或者用这些命令来下载数据集样本:
并将它们移动至 `data/OpenLane-V2/` 文件夹下解压。 生成的目录结构应[如下](./data/README.md#hierarchy)所示。 或者用这些命令来下载数据集样本:
```sh
cd data/OpenLane-V2
......@@ -191,16 +172,17 @@ OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理
3. 在 jupyter notebook 上运行 [tutorial](./tutorial.ipynb) 来熟悉数据集与对应的开发工具。
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 训练模型
我们提供不同神经网络训练框架的插件来支持在我们的数据集上训练模型。
如果缺少你常用的训练框架,我们欢迎你的提议或对插件的共同维护。
我们提供不同神经网络训练框架的插件来支持在我们的数据集上训练模型。 如果缺少你常用的训练框架,我们欢迎你的提议或对插件的共同维护。
### mmdet3d
这个[插件](./plugin/mmdet3d/)基于 [mmdet3d v1.0.0rc6](https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0rc6),并且在以下的环境中进行过测试:
这个[插件](./plugin/mmdet3d/)
基于 [mmdet3d v1.0.0rc6](https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0rc6),并且在以下的环境中进行过测试:
- Python 3.8.15
- PyTorch 1.9.1
- CUDA 11.1
......@@ -211,30 +193,33 @@ OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理
请按照 mmdet3d 的[指引](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc6/docs/en/getting_started.md)来安装这个训练框架。
假设这个数据集安装在 `OpenLane-V2/` 目录下,并且 mmdet3d 安装在 `mmdetection3d/` 目录下,你可以通过软连接的方式将该插件引入到训练框架中:
```
└── mmdetection3d
└── projects
├── example_project
└── openlanev2 -> OpenLane-V2/plugin/mmdet3d
```
在将数据路径换成你的本地路径之后,你可以使用我们提供的 config 文件 `mmdetection3d/projects/openlanev2/configs/baseline.py` 来进行模型训练和各种 mmdet3d 中支持的操作。
并且可以通过在对模型进行推理时输入不同的选项来获取不同的功能,已经实现的功能有:`--eval-options dump=True dump_dir=/PATH/TO/DUMP` 来存储用于上传测试集结果的文件;`--eval-options visualization=True visualization_dir=/PATH/TO/VIS` 来对模型输出进行可视化。
并且可以通过在对模型进行推理时输入不同的选项来获取不同的功能,已经实现的功能有:`--eval-options dump=True dump_dir=/PATH/TO/DUMP`
来存储用于上传测试集结果的文件;`--eval-options visualization=True visualization_dir=/PATH/TO/VIS` 来对模型输出进行可视化。
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 基准和排行榜
我们将提供 OpenLane-Huawei 数据集的初始基准测试,欢迎您在这里添加您的工作!
基准和排行榜将在不久后发布,请持续关注。
| Method | OLS (main metric) (%) | $mAP_{LC}$ (%) | $mAP_{TE}$ (%) | $mAP_{LCLC}$ (%) | $mAP_{LCTE}$ (%) | F-Score* (%) |
| - | - | - | - | - | - | - |
| Method | OLS (main metric) (%) | $mAP\_{LC}$ (%) | $mAP\_{TE}$ (%) | $mAP\_{LCLC}$ (%) | $mAP\_{LCTE}$ (%) | F-Score\* (%) |
| -------- | --------------------- | --------------- | --------------- | ----------------- | ----------------- | ------------- |
| Baseline | 0.29 | 0.08 | 0.31 | 0.00 | 0.01 | 8.56 |
<sub>*在比赛和排行榜中不考虑车道中心线检测的 F-Score。
<sub>\*在比赛和排行榜中不考虑车道中心线检测的 F-Score。
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 引用
使用 OpenLane-Huawei 时请使用如下引用:
......@@ -249,7 +234,8 @@ OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理
}
```
我们的数据集是基于[NuScenes](https://www.nuscenes.org/nuscenes)[Argoverse](https://www.argoverse.org/av2.html)数据集工作拓展而来。如果引用本作,也请使用如下引用:
我们的数据集是基于[NuScenes](https://www.nuscenes.org/nuscenes)
[Argoverse](https://www.argoverse.org/av2.html)数据集工作拓展而来。如果引用本作,也请使用如下引用:
```bibtex
@article{ nuscenes2019,
......@@ -270,10 +256,10 @@ OpenLane-Huawei 数据集是自动驾驶领域用于道路结构感知和推理
<p align="right">(<a href="#top">回到顶部</a>)</p>
## 许可说明
使用 OpenLane-Huawei 数据集时,您需要在网站上注册并同意 [nuScenes](https://www.nuscenes.org/nuscenes)[Argoverse 2](https://www.argoverse.org/av2.html) 数据集的使用条款。
本项目的发布受 [Apache License 2.0](./LICENSE)许可认证。
使用 OpenLane-Huawei 数据集时,您需要在网站上注册并同意 [nuScenes](https://www.nuscenes.org/nuscenes)
[Argoverse 2](https://www.argoverse.org/av2.html) 数据集的使用条款。
本项目的发布受 [Apache License 2.0](./LICENSE)许可认证。
<p align="right">(<a href="#top">回到顶部</a>)</p>
## InternImage-based Baseline for CVPR23 OpenLane-V2 Challenge!!!!
We improve our baseline with a more powerful image backbone: **InternImage**, which shows its excellent ability within a series of leaderboards and benchmarks, such as *COCO* and *nuScenes*.
We improve our baseline with a more powerful image backbone: **InternImage**, which shows its excellent ability within a
series of leaderboards and benchmarks, such as *COCO* and *nuScenes*.
#### 1. Requirements
```bash
python>=3.8
torch==1.11
......@@ -13,8 +14,8 @@ mmsegmentation==0.29.1
timm
```
### 2. Install DCNv3 for InternImage
```bash
cd plugin/mmdet3d/baseline/models/backbones/ops_dcnv3
bash make.sh
......@@ -28,11 +29,10 @@ bash make.sh
Notes: InternImage provides abundant pre-trained model weights that can be used!!!
### 4. Performance compared to baseline
| | OpenLane-V2 Score | DET<sub>l</sub> | DET<sub>t</sub> | TOP<sub>ll</sub> | TOP<sub>lt</sub> | F-Score |
|-------------|-------------------|-----------------|-----------------|------------------|------------------|---------|
| ----------- | ----------------- | --------------- | --------------- | ---------------- | ---------------- | ------- |
| base r50 | 0.292 | 0.183 | 0.457 | 0.022 | 0.143 | 0.215 |
| InternImage | 0.325 | 0.194 | 0.537 | 0.02 | 0.17 | 0.224 |
......@@ -41,11 +41,13 @@ Notes: InternImage provides abundant pre-trained model weights that can be used!
InternImage-S: [download](https://drive.google.com/file/d/1PsyVOEkCdo-q-jxeDKGRjw28_kWWm1d1/view?usp=sharing)
## Leaderboard
To be released.
<div id="top" align="center">
# OpenLane-V2
**The World's First Perception and Reasoning Benchmark for Scene Structure in Autonomous Driving.**
<a href="#data">
......@@ -62,7 +64,6 @@ To be released.
_In terms of ambiguity, the English version shall prevail._
<img src="./imgs/poster.gif" width="696px">
</div>
......@@ -72,6 +73,7 @@ _In terms of ambiguity, the English version shall prevail._
> The dataset name OpenLane-V2, is termed as **RoadGenome** at Huawei.
## Table of Contents
- [News](#news)
- [Benchmark and Leaderboard](#benchmark-and-leaderboard)
- [Highlight](#highlight---why-we-are-exclusive)
......@@ -87,90 +89,106 @@ _In terms of ambiguity, the English version shall prevail._
- [License](#license)
## News
- [2023/03]
* We are hosting a Challenge at the [CVPR 2023 Workshop](https://opendrivelab.com/AD23Challenge.html) :star:.
- [2023/02]
* Dataset `v1.0`: Data of `subset_A` released.
* Baseline model released.
- [2023/01]
* Dataset `v0.1`: Initial OpenLane-V2 dataset sample released.
* Devkit `v0.1.0`: Initial OpenLane-V2 devkit released.
- \[2023/03\]
- We are hosting a Challenge at the [CVPR 2023 Workshop](https://opendrivelab.com/AD23Challenge.html) :star:.
- \[2023/02\]
- Dataset `v1.0`: Data of `subset_A` released.
- Baseline model released.
- \[2023/01\]
- Dataset `v0.1`: Initial OpenLane-V2 dataset sample released.
- Devkit `v0.1.0`: Initial OpenLane-V2 devkit released.
<p align="right">(<a href="#top">back to top</a>)</p>
## Benchmark and Leaderboard
We will provide an initial benchmark on the OpenLane-V2 dataset, please stay tuned for the release.
Currently, we are maintaining leaderboards on the [*val*](https://paperswithcode.com/sota/3d-lane-detection-on-openlane-v2-2) and [*test*](https://eval.ai/web/challenges/challenge-page/1925/leaderboard/4549) split of `subset_A`.
We will provide an initial benchmark on the OpenLane-V2 dataset, please stay tuned for the release.
Currently, we are maintaining leaderboards on the [\*
val\*](https://paperswithcode.com/sota/3d-lane-detection-on-openlane-v2-2) and [\*
test\*](https://eval.ai/web/challenges/challenge-page/1925/leaderboard/4549) split of `subset_A`.
<p align="right">(<a href="#top">back to top</a>)</p>
## Highlight - why we are exclusive?
### The world is three-dimensional - Introducing 3D lane
Previous datasets annotate lanes on images in the perspective view. Such a type of 2D annotation is insufficient to fulfill real-world requirements.
Following the [OpenLane](https://github.com/OpenDriveLab/OpenLane) dataset, we annotate **lanes in 3D space** to reflect their properties in the real world.
Previous datasets annotate lanes on images in the perspective view. Such a type of 2D annotation is insufficient to
fulfill real-world requirements. Following the [OpenLane](https://github.com/OpenDriveLab/OpenLane) dataset, we
annotate **lanes in 3D space** to reflect their properties in the real world.
### Be aware of traffic signals - Recognizing Extremely Small road elements
Not only preventing collision but also facilitating efficiency is essential.
Vehicles follow predefined traffic rules for self-disciplining and cooperating with others to ensure a safe and efficient traffic system.
Not only preventing collision but also facilitating efficiency is essential. Vehicles follow predefined traffic rules
for self-disciplining and cooperating with others to ensure a safe and efficient traffic system.
**Traffic elements** on the roads, such as traffic lights and road signs, provide practical and real-time information.
### Beyond perception - Topology Reasoning between lane and road elements
A traffic element is only valid for its corresponding lanes.
Following the wrong signals would be catastrophic.
Also, lanes have their predecessors and successors to build the map.
Autonomous vehicles are required to **reason** about the **topology relationships** to drive in the right way.
In this dataset, we hope to shed light on the task of **scene structure perception and reasoning**.
A traffic element is only valid for its corresponding lanes. Following the wrong signals would be catastrophic. Also,
lanes have their predecessors and successors to build the map. Autonomous vehicles are required to **reason** about
the **topology relationships** to drive in the right way. In this dataset, we hope to shed light on the task of **scene
structure perception and reasoning**.
### Data scale and diversity matters - building on Top of Awesome Benchmarks
Experience from the sunny day does not apply to the dancing snowflakes.
For machine learning, data is the must-have food.
We provide annotations on data collected in various cities, from Austin to Singapore and from Boston to Miami.
Experience from the sunny day does not apply to the dancing snowflakes. For machine learning, data is the must-have
food. We provide annotations on data collected in various cities, from Austin to Singapore and from Boston to Miami.
The **diversity** of data enables models to generalize in different atmospheres and landscapes.
<p align="right">(<a href="#top">back to top</a>)</p>
## Task
The primary task of the dataset is **scene structure perception and reasoning**, which requires the model to recognize the dynamic drivable states of lanes in the surrounding environment.
The challenge of this dataset includes not only detecting lane centerlines and traffic elements but also recognizing the attribute of traffic elements and topology relationships on detected objects.
We define the **[OpenLane-V2 Score (OLS)](./docs/metrics.md#openlane-v2-score)**, which is the average of various metrics covering different aspects of the primary task:
$$
\text{OLS} = \frac{1}{4} \bigg[ \text{DET}_{l} + \text{DET}_{t} + f(\text{TOP}_{ll}) + f(\text{TOP}_{lt}) \bigg].
$$
The primary task of the dataset is **scene structure perception and reasoning**, which requires the model to recognize
the dynamic drivable states of lanes in the surrounding environment. The challenge of this dataset includes not only
detecting lane centerlines and traffic elements but also recognizing the attribute of traffic elements and topology
relationships on detected objects. We define the **[OpenLane-V2 Score (OLS)](./docs/metrics.md#openlane-v2-score)**,
which is the average of various metrics covering different aspects of the primary task:
$$ \\text{OLS} = \\frac{1}{4} \\bigg\[ \\text{DET}_{l} + \\text{DET}_{t} + f(\\text{TOP}_{ll}) + f(\\text{TOP}_{lt})
\\bigg\]. $$
The metrics of different subtasks are described below.
### 3D Lane Detection 🛣️
The [OpenLane](https://github.com/OpenDriveLab/OpenLane) dataset, which is the first real-world and the largest scaled 3D lane dataset to date, provides lane line annotations in 3D space.
Similarly, we annotate 3D lane centerlines and include the F-Score for evaluating predicted results of undirected lane centerlines.
Furthermore, we define the subtask of 3D lane detection as detecting directed 3D lane centerlines from the given multi-view images covering the whole horizontal FOV.
The instance-level evaluation metric of average precision $\text{DET}_{l}$ is utilized to measure the detection performance on lane centerlines (l).
The [OpenLane](https://github.com/OpenDriveLab/OpenLane) dataset, which is the first real-world and the largest scaled
3D lane dataset to date, provides lane line annotations in 3D space. Similarly, we annotate 3D lane centerlines and
include the F-Score for evaluating predicted results of undirected lane centerlines. Furthermore, we define the subtask
of 3D lane detection as detecting directed 3D lane centerlines from the given multi-view images covering the whole
horizontal FOV. The instance-level evaluation metric of average precision $\\text{DET}\_{l}$ is utilized to measure the
detection performance on lane centerlines (l).
<p align="center">
<img src="./imgs/lane.gif" width="696px" >
</p>
### Traffic Element Recognition 🚥
Traffic elements and their attribute provide crucial information for autonomous vehicles.
The attribute represents the semantic meaning of a traffic element, such as the red color of a traffic light.
In this subtask, on the given image in the front view, the location of traffic elements (traffic lights and road signs) and their attributes are demanded to be perceived simultaneously.
Compared to typical 2D detection datasets, the challenge is that the size of traffic elements is tiny due to the large scale of outdoor environments.
Similar to the typical 2D detection task, the metric of $\text{DET}_{t}$ is utilized to measure the performance of traffic elements (t) detection averaged over different attributes.
Traffic elements and their attribute provide crucial information for autonomous vehicles. The attribute represents the
semantic meaning of a traffic element, such as the red color of a traffic light. In this subtask, on the given image in
the front view, the location of traffic elements (traffic lights and road signs) and their attributes are demanded to be
perceived simultaneously. Compared to typical 2D detection datasets, the challenge is that the size of traffic elements
is tiny due to the large scale of outdoor environments. Similar to the typical 2D detection task, the metric of
$\\text{DET}\_{t}$ is utilized to measure the performance of traffic elements (t) detection averaged over different
attributes.
<p align="center">
<img src="./imgs/traffic_element.gif" width="696px" >
</p>
### Topology Recognition 🕸️
We first define the task of recognizing topology relationships in the field of autonomous driving.
Given multi-view images, the model learns to recognize the topology relationships among lane centerlines and between lane centerlines and traffic elements.
The most similar task is link prediction in the field of graph, in which the vertices are given and only edges are predicted by models.
In our case, both vertices and edges are unknown for the model.
Thus, lane centerlines and traffic elements are needed to be detected first, and then the topology relationships are built.
Adapted from the task of link prediction, $\text{TOP}$ is used for topology among lane centerlines (ll) and between lane centerlines and traffic elements (lt).
We first define the task of recognizing topology relationships in the field of autonomous driving. Given multi-view
images, the model learns to recognize the topology relationships among lane centerlines and between lane centerlines and
traffic elements. The most similar task is link prediction in the field of graph, in which the vertices are given and
only edges are predicted by models. In our case, both vertices and edges are unknown for the model. Thus, lane
centerlines and traffic elements are needed to be detected first, and then the topology relationships are built. Adapted
from the task of link prediction, $\\text{TOP}$ is used for topology among lane centerlines (ll) and between lane
centerlines and traffic elements (lt).
<p align="center">
<img src="./imgs/topology.gif" width="696px" >
......@@ -179,29 +197,34 @@ Adapted from the task of link prediction, $\text{TOP}$ is used for topology amon
<p align="right">(<a href="#top">back to top</a>)</p>
## Data
The OpenLane-V2 dataset is a large-scale dataset for scene structure perception and reasoning in the field of autonomous driving.
Following [OpenLane](https://github.com/OpenDriveLab/OpenLane), the first 3D lane dataset, we provide lane annotations in 3D space.
The difference is that instead of lane lines, we annotate lane centerlines, which can be served as the trajectory for autonomous vehicles.
Besides, we provide annotations on traffic elements (traffic lights and road signs) and their attribute, and the topology relationships among lane centerlines and between lane centerlines and traffic elements.
The OpenLane-V2 dataset is a large-scale dataset for scene structure perception and reasoning in the field of autonomous
driving. Following [OpenLane](https://github.com/OpenDriveLab/OpenLane), the first 3D lane dataset, we provide lane
annotations in 3D space. The difference is that instead of lane lines, we annotate lane centerlines, which can be served
as the trajectory for autonomous vehicles. Besides, we provide annotations on traffic elements (traffic lights and road
signs) and their attribute, and the topology relationships among lane centerlines and between lane centerlines and
traffic elements.
The dataset is divided into two subsets.
**The `subset_A` serves as the primary subset and is utilized for the coming challenges and leaderboard, in which no external data, including the other subset, is allowed**.
The `subset_B` can be used to test the generalization ability of the model.
For more details, please refer to the corresponding pages: [use of data](./data/README.md), [notes of annotation](./docs/annotation.md), and [dataset statistics](./docs/statistics.md).
**The `subset_A` serves as the primary subset and is utilized for the coming challenges and leaderboard, in which no
external data, including the other subset, is allowed**. The `subset_B` can be used to test the generalization ability
of the model. For more details, please refer to the corresponding pages: [use of data](./data/README.md)
, [notes of annotation](./docs/annotation.md), and [dataset statistics](./docs/statistics.md).
[Download](./data/README.md#download) now to discover our dataset!
<p align="right">(<a href="#top">back to top</a>)</p>
## Devkit
We provide a devkit for easy access to the OpenLane-V2 dataset.
After installing the package, the use of the dataset, such as loading images, loading meta data, and evaluating results, can be accessed through the API of `openlanv2`.
For more details on the API, please refer to [devkit](./docs/devkit.md).
<p align="right">(<a href="#top">back to top</a>)</p>
We provide a devkit for easy access to the OpenLane-V2 dataset. After installing the package, the use of the dataset,
such as loading images, loading meta data, and evaluating results, can be accessed through the API of `openlanv2`. For
more details on the API, please refer to [devkit](./docs/devkit.md).
<p align="right">(<a href="#top">back to top</a>)</p>
## Get Started
Please follow the steps below to get familiar with the OpenLane-V2 dataset.
1. Run the following commands to install the environment for setting up the dataset:
......@@ -221,9 +244,9 @@ Please follow the steps below to get familiar with the OpenLane-V2 dataset.
- <img src="https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png" alt="Google Drive" width="18"/> Google Drive,
- <img src="https://nd-static.bdstatic.com/m-static/v20-main/favicon-main.ico" alt="Baidu Yun" width="18"/> Baidu Yun.
Then put them into the `data/OpenLane-V2/` folder and unzip them.
The resulting folder hierarchy is described [here](./data/README.md#hierarchy).
Or use the following commands to download example data for a quick glance at the dataset:
Then put them into the `data/OpenLane-V2/` folder and unzip them. The resulting folder hierarchy is
described [here](./data/README.md#hierarchy). Or use the following commands to download example data for a quick
glance at the dataset:
```sh
cd data/OpenLane-V2
......@@ -237,14 +260,16 @@ Please follow the steps below to get familiar with the OpenLane-V2 dataset.
<p align="right">(<a href="#top">back to top</a>)</p>
## Train a Model
Plug-ins to prevail deep learning frameworks for training models are provided to start training models on the OpenLane-V2 dataset.
We appreciate your valuable feedback and contributions to plug-ins on different frameworks.
Plug-ins to prevail deep learning frameworks for training models are provided to start training models on the
OpenLane-V2 dataset. We appreciate your valuable feedback and contributions to plug-ins on different frameworks.
### mmdet3d
The [plug-in](./plugin/mmdet3d/) to MMDetection3d is built on top of [mmdet3d v1.0.0rc6](https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0rc6) and tested under:
The [plug-in](./plugin/mmdet3d/) to MMDetection3d is built on top
of [mmdet3d v1.0.0rc6](https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0rc6) and tested under:
- Python 3.8.15
- PyTorch 1.9.1
- CUDA 11.1
......@@ -253,22 +278,26 @@ The [plug-in](./plugin/mmdet3d/) to MMDetection3d is built on top of [mmdet3d v1
- mmdet==2.26.0
- mmsegmentation==0.29.1
Please follow the [instruction](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc6/docs/en/getting_started.md) to install mmdet3d.
Assuming OpenLane-V2 is installed under `OpenLane-V2/` and mmdet3d is built under `mmdetection3d/`, create a soft link to the plug-in file:
Please follow the [instruction](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc6/docs/en/getting_started.md)
to install mmdet3d. Assuming OpenLane-V2 is installed under `OpenLane-V2/` and mmdet3d is built under `mmdetection3d/`,
create a soft link to the plug-in file:
```
└── mmdetection3d
└── projects
├── example_project
└── openlanev2 -> OpenLane-V2/plugin/mmdet3d
```
Then you can train or evaluate a model using the config `mmdetection3d/projects/openlanev2/configs/baseline.py`, whose path is replaced accordingly.
Options can be passed to enable supported functions during evaluation, such as `--eval-options dump=True dump_dir=/PATH/TO/DUMP` to save pickle file for submission and `--eval-options visualization=True visualization_dir=/PATH/TO/VIS` for visualization.
Then you can train or evaluate a model using the config `mmdetection3d/projects/openlanev2/configs/baseline.py`, whose
path is replaced accordingly. Options can be passed to enable supported functions during evaluation, such
as `--eval-options dump=True dump_dir=/PATH/TO/DUMP` to save pickle file for submission
and `--eval-options visualization=True visualization_dir=/PATH/TO/VIS` for visualization.
<p align="right">(<a href="#top">back to top</a>)</p>
## Citation
Please use the following citation when referencing OpenLane-V2:
```bibtex
......@@ -285,10 +314,13 @@ Please use the following citation when referencing OpenLane-V2:
## License
Before using the dataset, you should register on the website and agree to the terms of use of the [nuScenes](https://www.nuscenes.org/nuscenes).
Before using the dataset, you should register on the website and agree to the terms of use of
the [nuScenes](https://www.nuscenes.org/nuscenes).
Our dataset is built on top of the [nuScenes](https://www.nuscenes.org/nuscenes) and [Argoverse 2](https://www.argoverse.org/av2.html) datasets.
Before using the OpenLane-V2 dataset, you should agree to the terms of use of the [nuScenes](https://www.nuscenes.org/nuscenes) and [Argoverse 2](https://www.argoverse.org/av2.html) datasets respectively.
Our dataset is built on top of the [nuScenes](https://www.nuscenes.org/nuscenes)
and [Argoverse 2](https://www.argoverse.org/av2.html) datasets. Before using the OpenLane-V2 dataset, you should agree
to the terms of use of the [nuScenes](https://www.nuscenes.org/nuscenes)
and [Argoverse 2](https://www.argoverse.org/av2.html) datasets respectively.
All code within this repository is under [Apache License 2.0](./LICENSE).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment