From 040ee9366f3874114260dabb8151872fc89326c5 Mon Sep 17 00:00:00 2001 From: cq Date: Thu, 3 Nov 2022 23:23:37 +0800 Subject: [PATCH 1/7] replace defaultformatbundle3d with pack3ddetinputs --- configs/_base_/datasets/lyft-3d-range100.py | 17 ++++------------- configs/_base_/datasets/nuim-instance.py | 9 +++++---- configs/centerpoint/README.md | 8 ++------ configs/nuimages/htc_r50_fpn_1x_nuim.py | 5 +---- .../nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py | 9 +++++---- .../mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py | 9 +++++---- .../mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py | 9 +++++---- ...A2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py | 8 ++------ ...101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py | 11 +++-------- 9 files changed, 32 insertions(+), 53 deletions(-) diff --git a/configs/_base_/datasets/lyft-3d-range100.py b/configs/_base_/datasets/lyft-3d-range100.py index cc1ce49908..03cd21f4e2 100644 --- a/configs/_base_/datasets/lyft-3d-range100.py +++ b/configs/_base_/datasets/lyft-3d-range100.py @@ -39,8 +39,7 @@ dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), dict(type='PointShuffle'), - dict(type='DefaultFormatBundle3D', class_names=class_names), - dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) + dict(type='Pack3DDetInputs', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), @@ -59,23 +58,15 @@ dict(type='RandomFlip3D'), dict( type='PointsRangeFilter', point_cloud_range=point_cloud_range), - dict( - type='DefaultFormatBundle3D', - class_names=class_names, - with_label=False), - dict(type='Collect3D', keys=['points']) - ]) + ]), + dict(type='Pack3DDetInputs', keys=['points']) ] # construct a pipeline for data and gt loading in show function # please keep its loading function consistent with test_pipeline (e.g. client) eval_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), - dict( - type='DefaultFormatBundle3D', - class_names=class_names, - with_label=False), - dict(type='Collect3D', keys=['points']) + dict(type='Pack3DDetInputs', keys=['points']) ] data = dict( diff --git a/configs/_base_/datasets/nuim-instance.py b/configs/_base_/datasets/nuim-instance.py index 3587c2d4db..99501c12f3 100644 --- a/configs/_base_/datasets/nuim-instance.py +++ b/configs/_base_/datasets/nuim-instance.py @@ -25,8 +25,7 @@ dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']), + dict(type='PackDetInputs'), ] test_pipeline = [ dict(type='LoadImageFromFile'), @@ -40,8 +39,10 @@ dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), - dict(type='Collect', keys=['img']), - ]) + ]), + dict(type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( samples_per_gpu=2, diff --git a/configs/centerpoint/README.md b/configs/centerpoint/README.md index d3f2006b23..b76b8a6a44 100644 --- a/configs/centerpoint/README.md +++ b/configs/centerpoint/README.md @@ -91,12 +91,8 @@ test_pipeline = [ dict(type='RandomFlip3D', sync_2d=False), dict( type='PointsRangeFilter', point_cloud_range=point_cloud_range), - dict( - type='DefaultFormatBundle3D', - class_names=class_names, - with_label=False), - dict(type='Collect3D', keys=['points']) - ]) + ]), + dict(type='Pack3DDetInputs', keys=['points']) ] data = dict( diff --git a/configs/nuimages/htc_r50_fpn_1x_nuim.py b/configs/nuimages/htc_r50_fpn_1x_nuim.py index 46806836f9..5c2597961d 100644 --- a/configs/nuimages/htc_r50_fpn_1x_nuim.py +++ b/configs/nuimages/htc_r50_fpn_1x_nuim.py @@ -33,10 +33,7 @@ dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='SegRescale', scale_factor=1 / 8), - dict(type='DefaultFormatBundle'), - dict( - type='Collect', - keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg']) + dict(type='PackDetInputs') ] data = dict( train=dict( diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py index 6535326fab..549ec504f6 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py @@ -22,8 +22,7 @@ dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']), + dict(type='PackDetInputs'), ] test_pipeline = [ dict(type='LoadImageFromFile'), @@ -37,8 +36,10 @@ dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), - dict(type='Collect', keys=['img']), - ]) + ]), + dict(type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index e7ba039eae..14f09b3b08 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -22,8 +22,7 @@ dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']), + dict(type='PackDetInputs'), ] test_pipeline = [ dict(type='LoadImageFromFile'), @@ -37,8 +36,10 @@ dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), - dict(type='Collect', keys=['img']), - ]) + ]), + dict(type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index 5a98d4d79b..ecea26005c 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -22,8 +22,7 @@ dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle'), - dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']), + dict(type='PackDetInputs'), ] test_pipeline = [ dict(type='LoadImageFromFile'), @@ -37,8 +36,10 @@ dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), - dict(type='Collect', keys=['img']), - ]) + ]), + dict(type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py b/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py index 335d88b4f1..d019f93b49 100644 --- a/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py +++ b/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py @@ -124,12 +124,8 @@ dict(type='RandomFlip3D'), dict( type='PointsRangeFilter', point_cloud_range=point_cloud_range), - dict( - type='DefaultFormatBundle3D', - class_names=class_names, - with_label=False), - dict(type='Collect3D', keys=['points']) - ]) + ]), + dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( diff --git a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py index f5833eebd1..bd4d75d09c 100644 --- a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py +++ b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py @@ -60,9 +60,8 @@ dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), - dict(type='DefaultFormatBundle3D', class_names=class_names), dict( - type='Collect3D', + type='Pack3DDetInputs', keys=[ 'img', 'gt_bboxes', 'gt_bboxes_labels', 'attr_labels', 'gt_bboxes_3d', 'gt_labels_3d', 'centers2d', 'depths' @@ -78,12 +77,8 @@ dict(type='RandomFlip3D'), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), - dict( - type='DefaultFormatBundle3D', - class_names=class_names, - with_label=False), - dict(type='Collect3D', keys=['img']), - ]) + ]), + dict(type='Pack3DDetInputs', keys=['img']), ] data = dict( samples_per_gpu=2, From f78f053d94a01f4e6238086acc272cbef70bb678 Mon Sep 17 00:00:00 2001 From: cq Date: Mon, 7 Nov 2022 22:19:58 +0800 Subject: [PATCH 2/7] remove normalize, pad, imagetotensor from configs --- configs/_base_/datasets/nuim-instance.py | 5 ----- configs/nuimages/htc_r50_fpn_1x_nuim.py | 2 -- configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py | 5 ----- .../nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py | 5 ----- .../nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py | 5 ----- configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py | 9 ++++----- .../pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py | 6 +----- 7 files changed, 5 insertions(+), 32 deletions(-) diff --git a/configs/_base_/datasets/nuim-instance.py b/configs/_base_/datasets/nuim-instance.py index 99501c12f3..7cc08e07b3 100644 --- a/configs/_base_/datasets/nuim-instance.py +++ b/configs/_base_/datasets/nuim-instance.py @@ -23,8 +23,6 @@ multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), dict(type='PackDetInputs'), ] test_pipeline = [ @@ -36,9 +34,6 @@ transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='ImageToTensor', keys=['img']), ]), dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/nuimages/htc_r50_fpn_1x_nuim.py b/configs/nuimages/htc_r50_fpn_1x_nuim.py index 5c2597961d..9b27fbec0a 100644 --- a/configs/nuimages/htc_r50_fpn_1x_nuim.py +++ b/configs/nuimages/htc_r50_fpn_1x_nuim.py @@ -30,8 +30,6 @@ multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), dict(type='SegRescale', scale_factor=1 / 8), dict(type='PackDetInputs') ] diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py index 549ec504f6..6bdcfa8678 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py @@ -20,8 +20,6 @@ multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), dict(type='PackDetInputs'), ] test_pipeline = [ @@ -33,9 +31,6 @@ transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='ImageToTensor', keys=['img']), ]), dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index 14f09b3b08..9afe098552 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -20,8 +20,6 @@ multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), dict(type='PackDetInputs'), ] test_pipeline = [ @@ -33,9 +31,6 @@ transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='ImageToTensor', keys=['img']), ]), dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index ecea26005c..085c3812b3 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -20,8 +20,6 @@ multiscale_mode='range', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), dict(type='PackDetInputs'), ] test_pipeline = [ @@ -33,9 +31,6 @@ transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='ImageToTensor', keys=['img']), ]), dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', diff --git a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py index b0265a9066..8e1a0bcfd1 100644 --- a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py +++ b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py @@ -25,11 +25,10 @@ transforms=[ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), - dict(type='ImageToTensor', keys=['img']), - dict(type='Collect', keys=['img']), - ]) + ]), + dict(type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data_root = 'data/nuimages/' # data = dict( diff --git a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py index bd4d75d09c..96b355b2c7 100644 --- a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py +++ b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py @@ -58,8 +58,6 @@ with_bbox_depth=True), dict(type='Resize', img_scale=(1600, 900), keep_ratio=True), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), dict( type='Pack3DDetInputs', keys=[ @@ -75,10 +73,8 @@ flip=False, transforms=[ dict(type='RandomFlip3D'), - dict(type='Normalize', **img_norm_cfg), - dict(type='Pad', size_divisor=32), ]), - dict(type='Pack3DDetInputs', keys=['img']), + dict(type='Pack3DDetInputs', keys=['img']), ] data = dict( samples_per_gpu=2, From af5acc7000637b802bc0986293584a2099f3c1b8 Mon Sep 17 00:00:00 2001 From: cq Date: Mon, 7 Nov 2022 22:36:52 +0800 Subject: [PATCH 3/7] rm unused key 'img_norm_cfg' --- configs/_base_/datasets/nuim-instance.py | 2 -- configs/nuimages/htc_r50_fpn_1x_nuim.py | 2 -- configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py | 3 --- configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py | 3 --- configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py | 3 --- configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py | 2 -- configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py | 2 -- 7 files changed, 17 deletions(-) diff --git a/configs/_base_/datasets/nuim-instance.py b/configs/_base_/datasets/nuim-instance.py index 7cc08e07b3..0ba18669b8 100644 --- a/configs/_base_/datasets/nuim-instance.py +++ b/configs/_base_/datasets/nuim-instance.py @@ -4,8 +4,6 @@ 'car', 'truck', 'trailer', 'bus', 'construction_vehicle', 'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier' ] -img_norm_cfg = dict( - mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) file_client_args = dict(backend='disk') # Uncomment the following if use ceph or other file clients. diff --git a/configs/nuimages/htc_r50_fpn_1x_nuim.py b/configs/nuimages/htc_r50_fpn_1x_nuim.py index 9b27fbec0a..da110cc5e5 100644 --- a/configs/nuimages/htc_r50_fpn_1x_nuim.py +++ b/configs/nuimages/htc_r50_fpn_1x_nuim.py @@ -18,8 +18,6 @@ loss_weight=0.2))) data_root = 'data/nuimages/' -img_norm_cfg = dict( - mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict( diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py index 6bdcfa8678..aa0ea7992d 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py @@ -8,9 +8,6 @@ backbone=dict(norm_cfg=dict(requires_grad=False), style='caffe'), roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) -# use caffe img_norm -img_norm_cfg = dict( - mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index 9afe098552..c8e105b9a8 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -8,9 +8,6 @@ backbone=dict(norm_cfg=dict(requires_grad=False), style='caffe'), roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) -# use caffe img_norm -img_norm_cfg = dict( - mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index 085c3812b3..15d0ccb96b 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -8,9 +8,6 @@ backbone=dict(norm_cfg=dict(requires_grad=False), style='caffe'), roi_head=dict( bbox_head=dict(num_classes=10), mask_head=dict(num_classes=10))) -# use caffe img_norm -img_norm_cfg = dict( - mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True, with_mask=True), diff --git a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py index 8e1a0bcfd1..b407fed6bd 100644 --- a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py +++ b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py @@ -13,8 +13,6 @@ './data/nuscenes/': 's3://nuscenes/nuscenes/', 'data/nuscenes/': 's3://nuscenes/nuscenes/' })) -img_norm_cfg = dict( - mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) test_pipeline = [ dict(type='LoadImageFromFile'), diff --git a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py index 96b355b2c7..b03a12d08c 100644 --- a/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py +++ b/configs/pgd/pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py @@ -44,8 +44,6 @@ 'car', 'truck', 'trailer', 'bus', 'construction_vehicle', 'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier' ] -img_norm_cfg = dict( - mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False) train_pipeline = [ dict(type='LoadImageFromFileMono3D'), dict( From 27ced774acf808dcb958646be984724a90fbb96d Mon Sep 17 00:00:00 2001 From: cq Date: Mon, 7 Nov 2022 22:45:57 +0800 Subject: [PATCH 4/7] fix lint errors --- configs/_base_/datasets/lyft-3d-range100.py | 3 ++- configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py | 2 +- configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py | 2 +- configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py | 2 +- .../parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configs/_base_/datasets/lyft-3d-range100.py b/configs/_base_/datasets/lyft-3d-range100.py index 03cd21f4e2..76cd50834c 100644 --- a/configs/_base_/datasets/lyft-3d-range100.py +++ b/configs/_base_/datasets/lyft-3d-range100.py @@ -39,7 +39,8 @@ dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), dict(type='PointShuffle'), - dict(type='Pack3DDetInputs', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) + dict(type='Pack3DDetInputs', + keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index c8e105b9a8..cea86d8eee 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -29,7 +29,7 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', + dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor')), ] diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index 15d0ccb96b..6f966218d6 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -29,7 +29,7 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', + dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor')), ] diff --git a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py index b407fed6bd..49d9bac0b9 100644 --- a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py +++ b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py @@ -24,7 +24,7 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', + dict(type='PackDetInputs', meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor')), ] diff --git a/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py b/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py index d019f93b49..e382821a43 100644 --- a/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py +++ b/configs/parta2/PartA2_hv_secfpn_8xb2-cyclic-80e_kitti-3d-car.py @@ -125,7 +125,7 @@ dict( type='PointsRangeFilter', point_cloud_range=point_cloud_range), ]), - dict(type='Pack3DDetInputs', keys=['points']) + dict(type='Pack3DDetInputs', keys=['points']) ] train_dataloader = dict( From b8234fcde8ac98d74eb868f1a67c6eb3dd5203e6 Mon Sep 17 00:00:00 2001 From: cq Date: Mon, 7 Nov 2022 23:02:16 +0800 Subject: [PATCH 5/7] fix lint errors --- configs/_base_/datasets/nuim-instance.py | 4 ++-- configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py | 4 ++-- configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py | 4 ++-- configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py | 4 ++-- configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/_base_/datasets/nuim-instance.py b/configs/_base_/datasets/nuim-instance.py index 0ba18669b8..9ce25d9b85 100644 --- a/configs/_base_/datasets/nuim-instance.py +++ b/configs/_base_/datasets/nuim-instance.py @@ -34,8 +34,8 @@ dict(type='RandomFlip'), ]), dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', - 'scale_factor')), + meta_keys=('img_id', 'img_path', 'ori_shape', + 'img_shape', 'scale_factor')), ] data = dict( samples_per_gpu=2, diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py index aa0ea7992d..bdf57cca2d 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py @@ -30,8 +30,8 @@ dict(type='RandomFlip'), ]), dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', - 'scale_factor')), + meta_keys=('img_id', 'img_path', 'ori_shape', + 'img_shape', 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index cea86d8eee..733f75b64e 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -30,8 +30,8 @@ dict(type='RandomFlip'), ]), dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', - 'scale_factor')), + meta_keys=('img_id', 'img_path', 'ori_shape', + 'img_shape', 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index 6f966218d6..ed79c87b61 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -30,8 +30,8 @@ dict(type='RandomFlip'), ]), dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', - 'scale_factor')), + meta_keys=('img_id', 'img_path', 'ori_shape', + 'img_shape', 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py index 49d9bac0b9..5f74a68acd 100644 --- a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py +++ b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py @@ -25,8 +25,8 @@ dict(type='RandomFlip'), ]), dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', - 'scale_factor')), + meta_keys=('img_id', 'img_path', 'ori_shape', + 'img_shape', 'scale_factor')), ] data_root = 'data/nuimages/' # data = dict( From 090fbf0558310dcb6a75cd1a80256763411ac1d9 Mon Sep 17 00:00:00 2001 From: cq Date: Tue, 22 Nov 2022 22:39:57 +0800 Subject: [PATCH 6/7] fix lint error --- configs/_base_/datasets/lyft-3d-range100.py | 5 +++-- configs/_base_/datasets/nuim-instance.py | 7 ++++--- configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py | 7 ++++--- .../nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py | 7 ++++--- .../nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py | 7 ++++--- configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py | 7 ++++--- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/configs/_base_/datasets/lyft-3d-range100.py b/configs/_base_/datasets/lyft-3d-range100.py index 76cd50834c..b4ad57a693 100644 --- a/configs/_base_/datasets/lyft-3d-range100.py +++ b/configs/_base_/datasets/lyft-3d-range100.py @@ -39,8 +39,9 @@ dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), dict(type='PointShuffle'), - dict(type='Pack3DDetInputs', - keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) + dict( + type='Pack3DDetInputs', + keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), diff --git a/configs/_base_/datasets/nuim-instance.py b/configs/_base_/datasets/nuim-instance.py index 9ce25d9b85..bd9af457c3 100644 --- a/configs/_base_/datasets/nuim-instance.py +++ b/configs/_base_/datasets/nuim-instance.py @@ -33,9 +33,10 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', - 'img_shape', 'scale_factor')), + dict( + type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( samples_per_gpu=2, diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py index bdf57cca2d..d875742579 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_1x_nuim.py @@ -29,9 +29,10 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', - 'img_shape', 'scale_factor')), + dict( + type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py index 733f75b64e..d8466ae500 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_1x_nuim.py @@ -29,9 +29,10 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', - 'img_shape', 'scale_factor')), + dict( + type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py index ed79c87b61..c29f5b50e0 100644 --- a/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py +++ b/configs/nuimages/mask-rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py @@ -29,9 +29,10 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', - 'img_shape', 'scale_factor')), + dict( + type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data = dict( train=dict(pipeline=train_pipeline), diff --git a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py index 5f74a68acd..1177ab6dcd 100644 --- a/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py +++ b/configs/nuimages/mask-rcnn_r50_fpn_coco-2x_1x_nus-2d.py @@ -24,9 +24,10 @@ dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), ]), - dict(type='PackDetInputs', - meta_keys=('img_id', 'img_path', 'ori_shape', - 'img_shape', 'scale_factor')), + dict( + type='PackDetInputs', + meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', + 'scale_factor')), ] data_root = 'data/nuimages/' # data = dict( From 7c26283c84c4aa6c97ffb5a2c9b4e1dcd77d579f Mon Sep 17 00:00:00 2001 From: cq Date: Tue, 22 Nov 2022 22:45:16 +0800 Subject: [PATCH 7/7] xx --- .../dataset_converters/update_infos_to_v2.py | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tools/dataset_converters/update_infos_to_v2.py b/tools/dataset_converters/update_infos_to_v2.py index bec1ed3527..b8e8fdb06a 100644 --- a/tools/dataset_converters/update_infos_to_v2.py +++ b/tools/dataset_converters/update_infos_to_v2.py @@ -284,8 +284,8 @@ def update_nuscenes_infos(pkl_path, out_dir): ori_info_dict['ego2global_translation']) temp_data_info['lidar_points']['num_pts_feats'] = ori_info_dict.get( 'num_features', 5) - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'lidar_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['lidar_path']).name temp_data_info['lidar_points'][ 'lidar2ego'] = convert_quaternion_to_matrix( ori_info_dict['lidar2ego_rotation'], @@ -315,8 +315,8 @@ def update_nuscenes_infos(pkl_path, out_dir): temp_data_info['images'] = {} for cam in ori_info_dict['cams']: empty_img_info = get_empty_img_info() - empty_img_info['img_path'] = Path(ori_info_dict['cams'][cam][ - 'data_path']).name + empty_img_info['img_path'] = Path( + ori_info_dict['cams'][cam]['data_path']).name empty_img_info['cam2img'] = ori_info_dict['cams'][cam][ 'cam_intrinsic'].tolist() empty_img_info['sample_data_token'] = ori_info_dict['cams'][cam][ @@ -411,15 +411,15 @@ def update_kitti_infos(pkl_path, out_dir): temp_data_info['images']['CAM3']['cam2img'] = ori_info_dict['calib'][ 'P3'].tolist() - temp_data_info['images']['CAM2']['img_path'] = Path(ori_info_dict['image'][ - 'image_path']).name + temp_data_info['images']['CAM2']['img_path'] = Path( + ori_info_dict['image']['image_path']).name h, w = ori_info_dict['image']['image_shape'] temp_data_info['images']['CAM2']['height'] = h temp_data_info['images']['CAM2']['width'] = w temp_data_info['lidar_points']['num_pts_feats'] = ori_info_dict[ 'point_cloud']['num_features'] - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'point_cloud']['velodyne_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['point_cloud']['velodyne_path']).name rect = ori_info_dict['calib']['R0_rect'].astype(np.float32) Trv2c = ori_info_dict['calib']['Tr_velo_to_cam'].astype(np.float32) @@ -533,12 +533,12 @@ def update_s3dis_infos(pkl_path, out_dir): temp_data_info['sample_idx'] = i temp_data_info['lidar_points']['num_pts_feats'] = ori_info_dict[ 'point_cloud']['num_features'] - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'pts_path']).name - temp_data_info['pts_semantic_mask_path'] = Path(ori_info_dict[ - 'pts_semantic_mask_path']).name - temp_data_info['pts_instance_mask_path'] = Path(ori_info_dict[ - 'pts_instance_mask_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['pts_path']).name + temp_data_info['pts_semantic_mask_path'] = Path( + ori_info_dict['pts_semantic_mask_path']).name + temp_data_info['pts_instance_mask_path'] = Path( + ori_info_dict['pts_instance_mask_path']).name # TODO support camera # np.linalg.inv(info['axis_align_matrix'] @ extrinsic): depth2cam @@ -607,12 +607,12 @@ def update_scannet_infos(pkl_path, out_dir): temp_data_info = get_empty_standard_data_info() temp_data_info['lidar_points']['num_pts_feats'] = ori_info_dict[ 'point_cloud']['num_features'] - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'pts_path']).name - temp_data_info['pts_semantic_mask_path'] = Path(ori_info_dict[ - 'pts_semantic_mask_path']).name - temp_data_info['pts_instance_mask_path'] = Path(ori_info_dict[ - 'pts_instance_mask_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['pts_path']).name + temp_data_info['pts_semantic_mask_path'] = Path( + ori_info_dict['pts_semantic_mask_path']).name + temp_data_info['pts_instance_mask_path'] = Path( + ori_info_dict['pts_instance_mask_path']).name # TODO support camera # np.linalg.inv(info['axis_align_matrix'] @ extrinsic): depth2cam @@ -679,8 +679,8 @@ def update_sunrgbd_infos(pkl_path, out_dir): temp_data_info = get_empty_standard_data_info() temp_data_info['lidar_points']['num_pts_feats'] = ori_info_dict[ 'point_cloud']['num_features'] - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'pts_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['pts_path']).name calib = ori_info_dict['calib'] rt_mat = calib['Rt'] # follow Coord3DMode.convert_point @@ -688,8 +688,8 @@ def update_sunrgbd_infos(pkl_path, out_dir): ]) @ rt_mat.transpose(1, 0) depth2img = calib['K'] @ rt_mat temp_data_info['images']['CAM0']['depth2img'] = depth2img.tolist() - temp_data_info['images']['CAM0']['img_path'] = Path(ori_info_dict['image'][ - 'image_path']).name + temp_data_info['images']['CAM0']['img_path'] = Path( + ori_info_dict['image']['image_path']).name h, w = ori_info_dict['image']['image_shape'] temp_data_info['images']['CAM0']['height'] = h temp_data_info['images']['CAM0']['width'] = w @@ -761,8 +761,8 @@ def update_lyft_infos(pkl_path, out_dir): temp_data_info['ego2global'] = convert_quaternion_to_matrix( ori_info_dict['ego2global_rotation'], ori_info_dict['ego2global_translation']) - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'lidar_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['lidar_path']).name temp_data_info['lidar_points'][ 'lidar2ego'] = convert_quaternion_to_matrix( ori_info_dict['lidar2ego_rotation'], @@ -793,8 +793,8 @@ def update_lyft_infos(pkl_path, out_dir): temp_data_info['images'] = {} for cam in ori_info_dict['cams']: empty_img_info = get_empty_img_info() - empty_img_info['img_path'] = Path(ori_info_dict['cams'][cam][ - 'data_path']).name + empty_img_info['img_path'] = Path( + ori_info_dict['cams'][cam]['data_path']).name empty_img_info['cam2img'] = ori_info_dict['cams'][cam][ 'cam_intrinsic'].tolist() empty_img_info['sample_data_token'] = ori_info_dict['cams'][cam][ @@ -913,8 +913,8 @@ def update_waymo_infos(pkl_path, out_dir): 'point_cloud']['num_features'] temp_data_info['lidar_points']['timestamp'] = ori_info_dict[ 'timestamp'] - temp_data_info['lidar_points']['lidar_path'] = Path(ori_info_dict[ - 'point_cloud']['velodyne_path']).name + temp_data_info['lidar_points']['lidar_path'] = Path( + ori_info_dict['point_cloud']['velodyne_path']).name # TODO discuss the usage of Tr_velo_to_cam in lidar Trv2c = ori_info_dict['calib']['Tr_velo_to_cam'].astype(np.float32) @@ -934,8 +934,8 @@ def update_waymo_infos(pkl_path, out_dir): lidar_sweep = get_single_lidar_sweep() lidar_sweep['ego2global'] = ori_sweep['pose'] lidar_sweep['timestamp'] = ori_sweep['timestamp'] - lidar_sweep['lidar_points']['lidar_path'] = Path(ori_sweep[ - 'velodyne_path']).name + lidar_sweep['lidar_points']['lidar_path'] = Path( + ori_sweep['velodyne_path']).name # image sweeps image_sweep = get_single_image_sweep(camera_types) image_sweep['ego2global'] = ori_sweep['pose']