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] Fix Visualization problem while multi-gpu testing for monocular 3D object detection model #1066

Merged
merged 1 commit into from
Nov 22, 2021
Merged
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
4 changes: 2 additions & 2 deletions mmdet3d/core/visualizer/show_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def show_seg_result(points,
filename,
palette,
ignore_index=None,
show=True,
show=False,
snapshot=False):
"""Convert results into format that is directly readable for meshlab.

Expand Down Expand Up @@ -206,7 +206,7 @@ def show_multi_modality_result(img,
filename,
box_mode='lidar',
img_metas=None,
show=True,
show=False,
gt_bbox_color=(61, 102, 255),
pred_bbox_color=(241, 101, 72)):
"""Convert multi-modality detection results into 2D results.
Expand Down
9 changes: 6 additions & 3 deletions mmdet3d/datasets/kitti_mono_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def evaluate(self,
pklfile_prefix=None,
submission_prefix=None,
show=False,
out_dir=None):
out_dir=None,
pipeline=None):
"""Evaluation in KITTI protocol.

Args:
Expand All @@ -220,6 +221,8 @@ def evaluate(self,
Default: False.
out_dir (str, optional): Path to save the visualization results.
Default: None.
pipeline (list[dict], optional): raw data loading for showing.
Default: None.

Returns:
dict[str, float]: Results of each evaluation metric.
Expand Down Expand Up @@ -256,8 +259,8 @@ def evaluate(self,

if tmp_dir is not None:
tmp_dir.cleanup()
if show:
self.show(results, out_dir)
if show or out_dir:
self.show(results, out_dir, show=show, pipeline=pipeline)
return ap_dict

def bbox2result_kitti(self,
Expand Down
6 changes: 3 additions & 3 deletions mmdet3d/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
PointSegClassMapping)
# yapf: enable
from mmdet.datasets.builder import PIPELINES
from mmdet.datasets.pipelines import LoadImageFromFile
from mmdet.datasets.pipelines import LoadImageFromFile, MultiScaleFlipAug


def is_loading_function(transform):
Expand Down Expand Up @@ -40,12 +40,12 @@ def is_loading_function(transform):
return False
if obj_cls in loading_functions:
return True
if obj_cls in (MultiScaleFlipAug3D, ):
if obj_cls in (MultiScaleFlipAug3D, MultiScaleFlipAug):
return None
elif callable(transform):
if isinstance(transform, loading_functions):
return True
if isinstance(transform, MultiScaleFlipAug3D):
if isinstance(transform, (MultiScaleFlipAug3D, MultiScaleFlipAug)):
return None
return False

Expand Down