Skip to content

Commit

Permalink
Merge 6aaee79 into 2c13673
Browse files Browse the repository at this point in the history
  • Loading branch information
sunjiahao1999 committed Jun 25, 2023
2 parents 2c13673 + 6aaee79 commit 82c6f10
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 49 deletions.
2 changes: 1 addition & 1 deletion configs/_base_/datasets/semantickitti.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
dataset_type='semantickitti',
backend_args=backend_args),
dict(type='PointSegClassMapping'),
dict(type='Pack3DDetInputs', keys=['points'])
dict(type='Pack3DDetInputs', keys=['points', 'pts_semantic_mask'])
]
# construct a pipeline for data and gt loading in show function
# please keep its loading function consistent with test_pipeline (e.g. client)
Expand Down
2 changes: 1 addition & 1 deletion demo/mono_det_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main(args):
data_sample=result,
draw_gt=False,
show=args.show,
wait_time=0,
wait_time=-1,
out_file=args.out_dir,
pred_score_thr=args.score_thr,
vis_task='mono_det')
Expand Down
2 changes: 1 addition & 1 deletion demo/multi_modality_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def main(args):
data_sample=result,
draw_gt=False,
show=args.show,
wait_time=0,
wait_time=-1,
out_file=args.out_dir,
pred_score_thr=args.score_thr,
vis_task='multi-modality_det')
Expand Down
2 changes: 1 addition & 1 deletion demo/pcd_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def main(args):
data_sample=result,
draw_gt=False,
show=args.show,
wait_time=0,
wait_time=-1,
out_file=args.out_dir,
pred_score_thr=args.score_thr,
vis_task='lidar_det')
Expand Down
2 changes: 1 addition & 1 deletion demo/pcd_seg_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def main(args):
data_sample=result,
draw_gt=False,
show=args.show,
wait_time=0,
wait_time=-1,
out_file=args.out_dir,
vis_task='lidar_seg')

Expand Down
14 changes: 14 additions & 0 deletions mmdet3d/engine/hooks/visualization_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numpy as np
from mmengine.fileio import get
from mmengine.hooks import Hook
from mmengine.logging import print_log
from mmengine.runner import Runner
from mmengine.utils import mkdir_or_exist
from mmengine.visualization import Visualizer
Expand Down Expand Up @@ -56,6 +57,8 @@ def __init__(self,
vis_task: str = 'mono_det',
wait_time: float = 0.,
test_out_dir: Optional[str] = None,
draw_gt: bool = True,
draw_pred: bool = True,
backend_args: Optional[dict] = None):
self._visualizer: Visualizer = Visualizer.get_current_instance()
self.interval = interval
Expand All @@ -70,11 +73,20 @@ def __init__(self,
'needs to be excluded.')
self.vis_task = vis_task

if wait_time == -1:
print_log(

Check warning on line 77 in mmdet3d/engine/hooks/visualization_hook.py

View check run for this annotation

Codecov / codecov/patch

mmdet3d/engine/hooks/visualization_hook.py#L77

Added line #L77 was not covered by tests
'Manual control mode, press [Right] to next sample.',
logger='current')
else:
print_log(
'Autoplay mode, press [SPACE] to pause.', logger='current')
self.wait_time = wait_time
self.backend_args = backend_args
self.draw = draw
self.test_out_dir = test_out_dir
self._test_index = 0
self.draw_gt = draw_gt
self.draw_pred = draw_pred

def after_val_iter(self, runner: Runner, batch_idx: int, data_batch: dict,
outputs: Sequence[Det3DDataSample]) -> None:
Expand Down Expand Up @@ -208,6 +220,8 @@ def after_test_iter(self, runner: Runner, batch_idx: int, data_batch: dict,
'test sample',
data_input,
data_sample=data_sample,
draw_gt=self.draw_gt,
draw_pred=self.draw_pred,
show=self.show,
vis_task=self.vis_task,
wait_time=self.wait_time,
Expand Down
Loading

0 comments on commit 82c6f10

Please sign in to comment.