Skip to content

Commit

Permalink
feat(local_visualizer.py): add check dir exist (#1828)
Browse files Browse the repository at this point in the history
* feat(local_visualizer.py): add check dir exist

* fix(local_visualizer.py): use mmengine API

* format(local_visualizer.py): remove useless

* style(local_visualizer.py): format
  • Loading branch information
tpoisonooo authored Sep 16, 2022
1 parent 82fd2d9 commit 677954b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mmdet3d/visualization/local_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import mmcv
import numpy as np
from mmengine import mkdir_or_exist
from mmengine.dist import master_only
from torch import Tensor

Expand Down Expand Up @@ -605,6 +606,8 @@ def add_datasample(self,
win_name=name,
wait_time=wait_time)

mkdir_or_exist(out_file)

if out_file is not None:
if drawn_img_3d is not None:
mmcv.imwrite(drawn_img_3d[..., ::-1], out_file + '.jpg')
Expand Down

0 comments on commit 677954b

Please # to comment.