diff --git a/demo/mono_det_demo.py b/demo/mono_det_demo.py index 42416fd9f4..6fa70d985a 100644 --- a/demo/mono_det_demo.py +++ b/demo/mono_det_demo.py @@ -57,7 +57,7 @@ def parse_args(): call_args['inputs'] = dict( img=call_args.pop('img'), infos=call_args.pop('infos')) - call_args.pop('cam_type') + # call_args.pop('cam_type') if call_args['no_save_vis'] and call_args['no_save_pred']: call_args['out_dir'] = '' diff --git a/mmdet3d/apis/inferencers/base_3d_inferencer.py b/mmdet3d/apis/inferencers/base_3d_inferencer.py index 6564325e8c..173016fdff 100644 --- a/mmdet3d/apis/inferencers/base_3d_inferencer.py +++ b/mmdet3d/apis/inferencers/base_3d_inferencer.py @@ -167,7 +167,8 @@ def _dispatch_kwargs(self, kwargs['img_out_dir'] = out_dir kwargs['pred_out_dir'] = out_dir if cam_type != '': - kwargs['cam_type_dir'] = cam_type + kwargs['cam_type'] = cam_type + # kwargs['cam_type_dir'] = cam_type return super()._dispatch_kwargs(**kwargs) def __call__(self, diff --git a/mmdet3d/apis/inferencers/mono_det3d_inferencer.py b/mmdet3d/apis/inferencers/mono_det3d_inferencer.py index 22863ae166..82a23e52d0 100644 --- a/mmdet3d/apis/inferencers/mono_det3d_inferencer.py +++ b/mmdet3d/apis/inferencers/mono_det3d_inferencer.py @@ -117,6 +117,13 @@ def _inputs_to_list(self, lidar2cam = np.asarray( data_info['images'][cam_type]['lidar2cam'], dtype=np.float32) + + if cam2img.shape == (3, 3): + cam2img_fixed = np.eye(4) + cam2img_fixed[:3, :3] = cam2img + cam2img = cam2img_fixed + + if 'lidar2img' in data_info['images'][cam_type]: lidar2img = np.asarray( data_info['images'][cam_type]['lidar2img'],