open-mmlab / mmdetection3d

OpenMMLab's next-generation platform for general 3D object detection.
https://mmdetection3d.readthedocs.io/en/latest/
Apache License 2.0
5.34k stars 1.55k forks source link

[Bug] Predictions orientation - mAOE #3014

Closed VeeranjaneyuluToka closed 4 months ago

VeeranjaneyuluToka commented 4 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmdetection3d

Environment

sys.platform: linux Python: 3.7.10 (default, Feb 26 2021, 18:47:35) [GCC 7.3.0] CUDA available: True MUSA available: False numpy_random_seed: 2147483648 GPU 0: NVIDIA GeForce RTX 3090 Ti CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.1, V11.1.105 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.9.0 PyTorch compiling details: PyTorch built with:

TorchVision: 0.10.0 OpenCV: 4.9.0 MMEngine: 0.10.3 MMDetection: 3.3.0 MMDetection3D: 1.4.0+ spconv2.0: False

Reproduces the problem - code sample

I am using the centerpointnet architecture to train the model, i have built the GT and verified using browse_dataset.py, it shows correct. But when i trained a model and visualize predications, they have wrong orientation.

Reproduces the problem - command or script

Used the following config to train the model auto_scale_lr = dict(base_batch_size=6, enable=False) backend_args = None class_names = [ 'sailboat', ] custom_imports = dict( allow_failed_imports=False, imports=[ 'projects.AutowareCenterPoint.centerpoint', ]) data_prefix = dict(img='', pts='pointclouds') data_root = 'data/marine/' dataset_type = 'MarineDataset' db_sampler = dict( backend_args=None, classes=[ 'sailboat', ], data_root='data/marine/', info_path='data/marine/marine_dbinfos_train.pkl', points_loader=dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=[ 0, 1, 2, 3, ]), prepare=dict( filter_by_difficulty=[ -1, ], filter_by_min_points=dict(sailboat=5)), rate=1.0, sample_groups=dict(sailboat=2)) default_hooks = dict( checkpoint=dict(interval=1, save_optimizer=True, type='CheckpointHook'), logger=dict(interval=50, type='LoggerHook'), param_scheduler=dict(type='ParamSchedulerHook'), sampler_seed=dict(type='DistSamplerSeedHook'), timer=dict(type='IterTimerHook'), visualization=dict( draw=True, score_thr=0.7, show=True, type='Det3DVisualizationHook', vis_task='lidar_det', wait_time=2)) default_scope = 'mmdet3d' env_cfg = dict( cudnn_benchmark=False, dist_cfg=dict(backend='nccl'), mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0)) eval_pipeline = [ dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=4), dict(keys=[ 'points', ], type='Pack3DDetInputs'), ] input_modality = dict(use_camera=False, use_lidar=True) launcher = 'none' load_from = './work_dirs/centerpoint_marine_vesla_240724_80epochs/epoch_50.pth' log_level = 'INFO' log_processor = dict(by_epoch=True, type='LogProcessor', window_size=50) lr = 0.0001 metainfo = dict(classes=[ 'sailboat', ]) mode = 'train' model = dict( data_preprocessor=dict( type='Det3DDataPreprocessor', voxel=True, voxel_layer=dict( max_num_points=20, max_voxels=( 30000, 40000, ), point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], voxel_size=[ 0.8, 0.8, 8, ])), pts_backbone=dict( conv_cfg=dict(bias=False, type='Conv2d'), in_channels=32, layer_nums=[ 3, 5, 5, ], layer_strides=[ 1, 2, 2, ], norm_cfg=dict(eps=0.001, momentum=0.01, type='BN'), out_channels=[ 64, 128, 256, ], type='SECOND'), pts_bbox_head=dict( bbox_coder=dict( code_size=9, max_num=500, out_size_factor=1, pc_range=[ -200.0, -200.0, ], post_center_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], score_threshold=0.5, type='CenterPointBBoxCoder', voxel_size=[ 0.8, 0.8, ]), common_heads=dict( dim=( 3, 2, ), height=( 1, 2, ), reg=( 2, 2, ), rot=( 2, 2, ), vel=( 2, 2, )), in_channels=384, loss_bbox=dict( loss_weight=0.25, reduction='mean', type='mmdet.L1Loss'), loss_cls=dict(reduction='mean', type='mmdet.GaussianFocalLoss'), norm_bbox=True, separate_head=dict( final_kernel=3, init_bias=-2.19, type='SeparateHead'), share_conv_channel=64, tasks=[ dict(class_names=[ 'sailboat', ], num_class=1), ], type='CenterHead'), pts_middle_encoder=dict( in_channels=32, output_shape=( 500, 500, ), type='PointPillarsScatter'), pts_neck=dict( in_channels=[ 64, 128, 256, ], norm_cfg=dict(eps=0.001, momentum=0.01, type='BN'), out_channels=[ 128, 128, 128, ], type='SECONDFPN', upsample_cfg=dict(bias=False, type='deconv'), upsample_strides=[ 1, 2, 4, ], use_conv_for_no_stride=True), pts_voxel_encoder=dict( feat_channels=[ 32, 32, ], in_channels=4, legacy=False, norm_cfg=dict(eps=0.001, momentum=0.01, type='BN1d'), point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], type='PillarFeatureNetAutoware', use_voxel_center_z=False, voxel_size=[ 0.8, 0.8, 8, ], with_distance=False), test_cfg=dict( pts=dict( max_per_img=500, max_pool_nms=False, min_radius=[ 4, 12, 10, 1, 0.85, 0.175, ], nms_thr=0.5, nms_type='circle', out_size_factor=1, pc_range=[ -200.0, -200.0, ], post_center_limit_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], post_max_size=83, pre_max_size=1000, score_threshold=0.5, voxel_size=[ 0.8, 0.8, ])), train_cfg=dict( pts=dict( code_weights=[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2, ], dense_reg=1, gaussian_overlap=0.1, grid_size=[ 500, 500, 5, ], max_objs=500, min_radius=2, out_size_factor=1, point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], voxel_size=[ 0.8, 0.8, 8, ])), type='CenterPoint') optim_wrapper = dict( clip_grad=dict(max_norm=35, norm_type=2), optimizer=dict(lr=0.0001, type='AdamW', weight_decay=0.01), type='OptimWrapper') out_size_factor = 1 param_scheduler = [ dict( T_max=30, begin=0, by_epoch=True, convert_to_iter_based=True, end=30, eta_min=0.001, type='CosineAnnealingLR'), dict( T_max=50, begin=30, by_epoch=True, convert_to_iter_based=True, end=80, eta_min=1e-08, type='CosineAnnealingLR'), dict( T_max=30, begin=0, by_epoch=True, convert_to_iter_based=True, end=30, eta_min=0.8947368421052632, type='CosineAnnealingMomentum'), dict( T_max=50, begin=30, by_epoch=True, convert_to_iter_based=True, end=80, eta_min=1, type='CosineAnnealingMomentum'), ] point_cloud_range = [ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ] point_load_dim = 4 point_use_dim = [ 0, 1, 2, 3, ] resume = False test_cfg = dict() test_dataloader = dict( batch_size=1, dataset=dict( ann_file='marine_infos_val.pkl', backend_args=None, box_type_3d='LiDAR', data_prefix=dict(img='', pts='pointclouds'), data_root='data/marine/', metainfo=dict(classes=[ 'sailboat', ]), modality=dict(use_camera=False, use_lidar=True), pipeline=[ dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=4), dict( flip=False, img_scale=( 1333, 800, ), pts_scale_ratio=1, transforms=[ dict( rot_range=[ 0, 0, ], scale_ratio_range=[ 1.0, 1.0, ], translation_std=[ 0, 0, 0, ], type='GlobalRotScaleTrans'), dict(type='RandomFlip3D'), ], type='MultiScaleFlipAug3D'), dict(keys=[ 'points', ], type='Pack3DDetInputs'), ], test_mode=True, type='MarineDataset'), drop_last=False, num_workers=1, persistent_workers=True, sampler=dict(shuffle=False, type='DefaultSampler')) test_evaluator = dict( ann_file='data/marine/marine_infos_val.pkl', backend_args=None, data_root='data/marine/', metric='bbox', type='MarineMetric') test_pipeline = [ dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=4), dict( flip=False, img_scale=( 1333, 800, ), pts_scale_ratio=1, transforms=[ dict( rot_range=[ 0, 0, ], scale_ratio_range=[ 1.0, 1.0, ], translation_std=[ 0, 0, 0, ], type='GlobalRotScaleTrans'), dict(type='RandomFlip3D'), ], type='MultiScaleFlipAug3D'), dict(keys=[ 'points', ], type='Pack3DDetInputs'), ] train_cfg = dict(by_epoch=True, max_epochs=80, val_interval=10) train_dataloader = dict( batch_size=6, dataset=dict( dataset=dict( ann_file='marine_infos_train.pkl', backend_args=None, box_type_3d='LiDAR', data_prefix=dict(img='', pts='pointclouds'), data_root='data/marine/', metainfo=dict(classes=[ 'sailboat', ]), pipeline=[ dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=4), dict( type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( rot_range=[ -0.3925, 0.3925, ], scale_ratio_range=[ 0.95, 1.05, ], translation_std=[ 0, 0, 0, ], type='GlobalRotScaleTrans'), dict( flip_ratio_bev_horizontal=0.5, flip_ratio_bev_vertical=0.5, sync_2d=False, type='RandomFlip3D'), dict( point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], type='PointsRangeFilter'), dict( point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], type='ObjectRangeFilter'), dict(classes=[ 'sailboat', ], type='ObjectNameFilter'), dict(type='PointShuffle'), dict( keys=[ 'points', 'gt_bboxes_3d', 'gt_labels_3d', ], type='Pack3DDetInputs'), ], test_mode=False, type='MarineDataset', use_valid_flag=True), type='CBGSDataset'), num_workers=4, persistent_workers=True, sampler=dict(shuffle=True, type='DefaultSampler')) train_pipeline = [ dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=4), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( rot_range=[ -0.3925, 0.3925, ], scale_ratio_range=[ 0.95, 1.05, ], translation_std=[ 0, 0, 0, ], type='GlobalRotScaleTrans'), dict( flip_ratio_bev_horizontal=0.5, flip_ratio_bev_vertical=0.5, sync_2d=False, type='RandomFlip3D'), dict( point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], type='PointsRangeFilter'), dict( point_cloud_range=[ -200.0, -200.0, -8.0, 200.0, 200.0, 32.0, ], type='ObjectRangeFilter'), dict(classes=[ 'sailboat', ], type='ObjectNameFilter'), dict(type='PointShuffle'), dict( keys=[ 'points', 'gt_bboxes_3d', 'gt_labels_3d', ], type='Pack3DDetInputs'), ] val_cfg = dict() val_dataloader = dict( batch_size=1, dataset=dict( ann_file='marine_infos_val.pkl', backend_args=None, box_type_3d='LiDAR', data_prefix=dict(img='', pts='pointclouds'), data_root='data/marine/', metainfo=dict(classes=[ 'sailboat', ]), modality=dict(use_camera=False, use_lidar=True), pipeline=[ dict( backend_args=None, coord_type='LIDAR', load_dim=4, type='LoadPointsFromFile', use_dim=4), dict( flip=False, img_scale=( 1333, 800, ), pts_scale_ratio=1, transforms=[ dict( rot_range=[ 0, 0, ], scale_ratio_range=[ 1.0, 1.0, ], translation_std=[ 0, 0, 0, ], type='GlobalRotScaleTrans'), dict(type='RandomFlip3D'), ], type='MultiScaleFlipAug3D'), dict(keys=[ 'points', ], type='Pack3DDetInputs'), ], test_mode=True, type='MarineDataset'), drop_last=False, num_workers=1, persistent_workers=True, sampler=dict(shuffle=False, type='DefaultSampler')) val_evaluator = dict( ann_file='data/marine/marine_infos_val.pkl', backend_args=None, data_root='data/marine/', metric='bbox', type='MarineMetric') vis_backends = [ dict(type='LocalVisBackend'), dict(type='TensorboardVisBackend'), ] visualizer = dict( name='visualizer', type='Det3DLocalVisualizer', vis_backends=[ dict(type='LocalVisBackend'), dict(type='TensorboardVisBackend'), ]) voxel_size = [ 0.8, 0.8, 8, ] work_dir = './work_dirs/centerpoint_marine_vesla_240724_80epochs/'

Reproduces the problem - error message

image

Additional information

All the predictions should be in correct orientation.

VeeranjaneyuluToka commented 4 months ago

Found that this is due to errors in my training data. So closing this issue.

Xrenya commented 3 months ago

@VeeranjaneyuluToka I have a question regarding the dataset, is it private marine dataset or publicly available somewhere?