Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Resolve matrix dimension mismatch issue in _dispatch_kwargs #3062

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/mono_det_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = ''
Expand Down
3 changes: 2 additions & 1 deletion mmdet3d/apis/inferencers/base_3d_inferencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions mmdet3d/apis/inferencers/mono_det3d_inferencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down