Fix camera type dispatch in 3D demos#3144
Open
ziyangwang007 wants to merge 1 commit into
Open
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
--cam-typeargument inmono_det_demo.pyandmulti_modality_demo.pyis currently removed fromcall_argsbefore callingthe inferencer. As a result, the user-provided camera type is not propagated to
the preprocessing stage.
In addition,
Base3DInferencer._dispatch_kwargsconsumescam_typebut onlyuses it to set
cam_type_dir. It does not dispatchcam_typeback topreprocess_kwargs, soBase3DInferencer.__call__falls back to the defaultCAM2.This can cause demo failures such as
KeyError: 'CAM2'even when users passa valid camera type like
CAM0,CAM_BACK, orCAM_FRONT.Fixes #2881.
Fixes #2868.
Related to #2981.
Modification
cam_typeincall_argsindemo/mono_det_demo.py.cam_typeincall_argsindemo/multi_modality_demo.py.cam_typeto preprocess kwargs inBase3DInferencer._dispatch_kwargs.cam_typevalue forcam_type_dir, so savedvisualization directories remain consistent with the selected camera.
BC-breaking (Optional)
No backward-incompatible change is expected. The change makes the existing
--cam-typeargument take effect as intended.Use cases (Optional)
This fixes demo commands that explicitly specify a camera type, for example: