250 lines
5.5 KiB
YAML
250 lines
5.5 KiB
YAML
# 三任务基础配置
|
||
# 任务: 3D检测 + BEV分割 + 矢量地图
|
||
|
||
_base_:
|
||
- ../../det/transfusion/secfpn/camera+lidar/default.yaml
|
||
|
||
# 全局参数
|
||
voxel_size: [0.075, 0.075, 0.2]
|
||
point_cloud_range: [-54.0, -54.0, -5.0, 54.0, 54.0, 3.0]
|
||
bev_h: 180
|
||
bev_w: 180
|
||
|
||
# 图像参数
|
||
image_size: [256, 704]
|
||
|
||
# BEV范围(用于矢量地图)
|
||
bev_x_range: [-50, 50]
|
||
bev_y_range: [-50, 50]
|
||
|
||
# 矢量地图参数
|
||
num_vec_classes: 3 # divider, boundary, ped_crossing
|
||
max_num_vectors: 50
|
||
num_points_per_vec: 20
|
||
|
||
# nuScenes类别
|
||
object_classes:
|
||
- car
|
||
- truck
|
||
- construction_vehicle
|
||
- bus
|
||
- trailer
|
||
- barrier
|
||
- motorcycle
|
||
- bicycle
|
||
- pedestrian
|
||
- traffic_cone
|
||
|
||
map_classes:
|
||
- drivable_area
|
||
- ped_crossing
|
||
- walkway
|
||
- stop_line
|
||
- carpark_area
|
||
- divider
|
||
|
||
# 数据增强参数
|
||
augment2d:
|
||
resize: [[0.38, 0.55], [0.48, 0.48]]
|
||
rotate: [-5.4, 5.4]
|
||
gridmask:
|
||
prob: 0.0
|
||
fixed_prob: true
|
||
|
||
augment3d:
|
||
scale: [0.9, 1.1]
|
||
rotate: [-0.78539816, 0.78539816]
|
||
translate: 0.5
|
||
|
||
# 优化器参数
|
||
optimizer:
|
||
type: AdamW
|
||
lr: 2.0e-4
|
||
weight_decay: 0.01
|
||
|
||
optimizer_config:
|
||
grad_clip:
|
||
max_norm: 35
|
||
norm_type: 2
|
||
|
||
lr_config:
|
||
policy: cyclic
|
||
target_ratio: 5.0
|
||
cyclic_times: 1
|
||
step_ratio_up: 0.4
|
||
|
||
momentum_config:
|
||
policy: cyclic
|
||
target_ratio: 0.8 / 0.95
|
||
cyclic_times: 1
|
||
step_ratio_up: 0.4
|
||
|
||
# 训练参数
|
||
max_epochs: 20
|
||
batch_size_per_gpu: 1
|
||
num_workers_per_gpu: 4
|
||
checkpoint_interval: 1
|
||
|
||
# 数据集
|
||
data:
|
||
samples_per_gpu: ${batch_size_per_gpu}
|
||
workers_per_gpu: ${num_workers_per_gpu}
|
||
|
||
train:
|
||
type: NuScenesDataset
|
||
dataset_root: data/nuscenes
|
||
ann_file: data/nuscenes/nuscenes_infos_train.pkl
|
||
pipeline: ${train_pipeline}
|
||
object_classes: ${object_classes}
|
||
map_classes: ${map_classes}
|
||
modality:
|
||
use_camera: true
|
||
use_lidar: true
|
||
use_radar: false
|
||
use_map: false
|
||
use_external: false
|
||
|
||
val:
|
||
type: NuScenesDataset
|
||
dataset_root: data/nuscenes
|
||
ann_file: data/nuscenes/nuscenes_infos_val.pkl
|
||
pipeline: ${val_pipeline}
|
||
object_classes: ${object_classes}
|
||
map_classes: ${map_classes}
|
||
modality:
|
||
use_camera: true
|
||
use_lidar: true
|
||
use_radar: false
|
||
use_map: false
|
||
use_external: false
|
||
|
||
# 训练pipeline
|
||
train_pipeline:
|
||
- type: LoadMultiViewImageFromFiles
|
||
to_float32: true
|
||
- type: LoadPointsFromFile
|
||
coord_type: LIDAR
|
||
load_dim: ${load_dim}
|
||
use_dim: ${use_dim}
|
||
- type: LoadPointsFromMultiSweeps
|
||
sweeps_num: 9
|
||
use_dim: [0, 1, 2, 3, 4]
|
||
pad_empty_sweeps: true
|
||
remove_close: true
|
||
- type: LoadAnnotations3D
|
||
with_bbox_3d: true
|
||
with_label_3d: true
|
||
with_attr_label: false
|
||
- type: LoadBEVSegmentation
|
||
dataset_root: data/nuscenes
|
||
xbound: [-50.0, 50.0, 0.5]
|
||
ybound: [-50.0, 50.0, 0.5]
|
||
classes: ${map_classes}
|
||
- type: LoadVectorMap # 🆕 矢量地图加载
|
||
vector_map_file: data/nuscenes/vector_maps_bevfusion.pkl
|
||
num_vec_classes: ${num_vec_classes}
|
||
max_num_vectors: ${max_num_vectors}
|
||
num_points_per_vec: ${num_points_per_vec}
|
||
- type: ObjectRangeFilter
|
||
point_cloud_range: ${point_cloud_range}
|
||
- type: ObjectNameFilter
|
||
classes: ${object_classes}
|
||
- type: ImageAug3D
|
||
final_dim: ${image_size}
|
||
resize_lim: ${augment2d.resize[0]}
|
||
bot_pct_lim: [0.0, 0.0]
|
||
rot_lim: ${augment2d.rotate}
|
||
rand_flip: true
|
||
is_train: true
|
||
- type: GlobalRotScaleTrans
|
||
resize_lim: ${augment3d.scale}
|
||
rot_lim: ${augment3d.rotate}
|
||
trans_lim: ${augment3d.translate}
|
||
is_train: true
|
||
- type: PointsRangeFilter
|
||
point_cloud_range: ${point_cloud_range}
|
||
- type: PointShuffle
|
||
- type: DefaultFormatBundle3D
|
||
classes: ${object_classes}
|
||
- type: Collect3D
|
||
keys:
|
||
- img
|
||
- points
|
||
- gt_bboxes_3d
|
||
- gt_labels_3d
|
||
- gt_masks_bev
|
||
- gt_vectors_labels # 🆕
|
||
- gt_vectors_points # 🆕
|
||
meta_keys:
|
||
- camera_intrinsics
|
||
- camera2ego
|
||
- lidar2ego
|
||
- lidar2camera
|
||
- camera2lidar
|
||
- lidar2image
|
||
- img_aug_matrix
|
||
- lidar_aug_matrix
|
||
|
||
# 验证pipeline
|
||
val_pipeline:
|
||
- type: LoadMultiViewImageFromFiles
|
||
to_float32: true
|
||
- type: LoadPointsFromFile
|
||
coord_type: LIDAR
|
||
load_dim: ${load_dim}
|
||
use_dim: ${use_dim}
|
||
- type: LoadPointsFromMultiSweeps
|
||
sweeps_num: 9
|
||
use_dim: [0, 1, 2, 3, 4]
|
||
pad_empty_sweeps: true
|
||
remove_close: true
|
||
- type: LoadAnnotations3D
|
||
with_bbox_3d: true
|
||
with_label_3d: true
|
||
with_attr_label: false
|
||
- type: LoadBEVSegmentation
|
||
dataset_root: data/nuscenes
|
||
xbound: [-50.0, 50.0, 0.5]
|
||
ybound: [-50.0, 50.0, 0.5]
|
||
classes: ${map_classes}
|
||
- type: LoadVectorMap # 🆕
|
||
vector_map_file: data/nuscenes/vector_maps_bevfusion.pkl
|
||
num_vec_classes: ${num_vec_classes}
|
||
max_num_vectors: ${max_num_vectors}
|
||
num_points_per_vec: ${num_points_per_vec}
|
||
- type: ImageAug3D
|
||
final_dim: ${image_size}
|
||
resize_lim: ${augment2d.resize[1]}
|
||
bot_pct_lim: [0.0, 0.0]
|
||
rot_lim: [0.0, 0.0]
|
||
rand_flip: false
|
||
is_train: false
|
||
- type: GlobalRotScaleTrans
|
||
resize_lim: [1.0, 1.0]
|
||
rot_lim: [0.0, 0.0]
|
||
trans_lim: 0.0
|
||
is_train: false
|
||
- type: PointsRangeFilter
|
||
point_cloud_range: ${point_cloud_range}
|
||
- type: DefaultFormatBundle3D
|
||
classes: ${object_classes}
|
||
- type: Collect3D
|
||
keys:
|
||
- img
|
||
- points
|
||
- gt_bboxes_3d
|
||
- gt_labels_3d
|
||
- gt_masks_bev
|
||
- gt_vectors_labels # 🆕
|
||
- gt_vectors_points # 🆕
|
||
meta_keys:
|
||
- camera_intrinsics
|
||
- camera2ego
|
||
- lidar2ego
|
||
- lidar2camera
|
||
- camera2lidar
|
||
- lidar2image
|
||
- img_aug_matrix
|
||
- lidar_aug_matrix
|
||
|