"torchvision/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "73281b4f98233bc11e068ce50e7f627e6ad6f84e"
Unverified Commit 81764388 authored by ChaimZhu's avatar ChaimZhu Committed by GitHub
Browse files

support only save output meshlab results while evaluating mAP (#1073)

parent 751ac205
...@@ -71,7 +71,7 @@ To see the prediction results during evaluation, you can run the following comma ...@@ -71,7 +71,7 @@ To see the prediction results during evaluation, you can run the following comma
python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'show=True' 'out_dir=${SHOW_DIR}' python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'show=True' 'out_dir=${SHOW_DIR}'
``` ```
After running this command, you will obtain the input data, the output of networks and ground-truth labels visualized on the input (e.g. `***_points.obj`, `***_pred.obj`, `***_gt.obj`, `***_img.png` and `***_pred.png` in multi-modality detection task) in `${SHOW_DIR}`. When `show` is enabled, [Open3D](http://www.open3d.org/) will be used to visualize the results online. You need to set `show=False` while running test in remote server without GUI. After running this command, you will obtain the input data, the output of networks and ground-truth labels visualized on the input (e.g. `***_points.obj`, `***_pred.obj`, `***_gt.obj`, `***_img.png` and `***_pred.png` in multi-modality detection task) in `${SHOW_DIR}`. When `show` is enabled, [Open3D](http://www.open3d.org/) will be used to visualize the results online. If you are running test in remote server without GUI, the online visualization is not supported, you can set `show=False` to only save the output results in `{SHOW_DIR}`.
As for offline visualization, you will have two options. As for offline visualization, you will have two options.
To visualize the results with `Open3D` backend, you can run the following command To visualize the results with `Open3D` backend, you can run the following command
......
...@@ -71,7 +71,7 @@ python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --show --show-dir ${SHOW_DIR} ...@@ -71,7 +71,7 @@ python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --show --show-dir ${SHOW_DIR}
python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'show=True' 'out_dir=${SHOW_DIR}' python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'show=True' 'out_dir=${SHOW_DIR}'
``` ```
在运行这个指令后,您将会在 `${SHOW_DIR}` 获得输入数据、可视化在输入上的网络输出和真值标签(例如:在多模态检测任务中的`***_points.obj``***_pred.obj``***_gt.obj``***_img.png``***_pred.png` )。当 `show` 被激活,[Open3D](http://www.open3d.org/) 将会被用来在线可视化结果。当在没有 GUI 的远程服务器上运行测试的时候,您需要设定 `show=False` 在运行这个指令后,您将会在 `${SHOW_DIR}` 获得输入数据、可视化在输入上的网络输出和真值标签(例如:在多模态检测任务中的`***_points.obj``***_pred.obj``***_gt.obj``***_img.png``***_pred.png` )。当 `show` 被激活,[Open3D](http://www.open3d.org/) 将会被用来在线可视化结果。当在没有 GUI 的远程服务器上运行测试的时候,无法进行在线可视化,您可以设定 `show=False` 将输出结果保存在 `{SHOW_DIR}`
至于离线可视化,您将有两个选择。 至于离线可视化,您将有两个选择。
利用 `Open3D` 后端可视化结果,您可以运行下面的指令 利用 `Open3D` 后端可视化结果,您可以运行下面的指令
......
...@@ -360,8 +360,8 @@ class KittiDataset(Custom3DDataset): ...@@ -360,8 +360,8 @@ class KittiDataset(Custom3DDataset):
if tmp_dir is not None: if tmp_dir is not None:
tmp_dir.cleanup() tmp_dir.cleanup()
if show: if show or out_dir:
self.show(results, out_dir, pipeline=pipeline) self.show(results, out_dir, show=show, pipeline=pipeline)
return ap_dict return ap_dict
def bbox2result_kitti(self, def bbox2result_kitti(self,
...@@ -698,7 +698,8 @@ class KittiDataset(Custom3DDataset): ...@@ -698,7 +698,8 @@ class KittiDataset(Custom3DDataset):
Args: Args:
results (list[dict]): List of bounding boxes results. results (list[dict]): List of bounding boxes results.
out_dir (str): Output directory of visualization result. out_dir (str): Output directory of visualization result.
show (bool): Visualize the results online. show (bool): Whether to visualize the results online.
Default: False.
pipeline (list[dict], optional): raw data loading for showing. pipeline (list[dict], optional): raw data loading for showing.
Default: None. Default: None.
""" """
......
...@@ -411,8 +411,8 @@ class LyftDataset(Custom3DDataset): ...@@ -411,8 +411,8 @@ class LyftDataset(Custom3DDataset):
if tmp_dir is not None: if tmp_dir is not None:
tmp_dir.cleanup() tmp_dir.cleanup()
if show: if show or out_dir:
self.show(results, out_dir, pipeline=pipeline) self.show(results, out_dir, show=show, pipeline=pipeline)
return results_dict return results_dict
def _build_default_pipeline(self): def _build_default_pipeline(self):
...@@ -436,13 +436,14 @@ class LyftDataset(Custom3DDataset): ...@@ -436,13 +436,14 @@ class LyftDataset(Custom3DDataset):
] ]
return Compose(pipeline) return Compose(pipeline)
def show(self, results, out_dir, show=True, pipeline=None): def show(self, results, out_dir, show=False, pipeline=None):
"""Results visualization. """Results visualization.
Args: Args:
results (list[dict]): List of bounding boxes results. results (list[dict]): List of bounding boxes results.
out_dir (str): Output directory of visualization result. out_dir (str): Output directory of visualization result.
show (bool): Visualize the results online. show (bool): Whether to visualize the results online.
Default: False.
pipeline (list[dict], optional): raw data loading for showing. pipeline (list[dict], optional): raw data loading for showing.
Default: None. Default: None.
""" """
......
...@@ -513,8 +513,8 @@ class NuScenesDataset(Custom3DDataset): ...@@ -513,8 +513,8 @@ class NuScenesDataset(Custom3DDataset):
if tmp_dir is not None: if tmp_dir is not None:
tmp_dir.cleanup() tmp_dir.cleanup()
if show: if show or out_dir:
self.show(results, out_dir, pipeline=pipeline) self.show(results, out_dir, show=show, pipeline=pipeline)
return results_dict return results_dict
def _build_default_pipeline(self): def _build_default_pipeline(self):
...@@ -538,13 +538,14 @@ class NuScenesDataset(Custom3DDataset): ...@@ -538,13 +538,14 @@ class NuScenesDataset(Custom3DDataset):
] ]
return Compose(pipeline) return Compose(pipeline)
def show(self, results, out_dir, show=True, pipeline=None): def show(self, results, out_dir, show=False, pipeline=None):
"""Results visualization. """Results visualization.
Args: Args:
results (list[dict]): List of bounding boxes results. results (list[dict]): List of bounding boxes results.
out_dir (str): Output directory of visualization result. out_dir (str): Output directory of visualization result.
show (bool): Visualize the results online. show (bool): Whether to visualize the results online.
Default: False.
pipeline (list[dict], optional): raw data loading for showing. pipeline (list[dict], optional): raw data loading for showing.
Default: None. Default: None.
""" """
......
...@@ -540,7 +540,7 @@ class NuScenesMonoDataset(CocoDataset): ...@@ -540,7 +540,7 @@ class NuScenesMonoDataset(CocoDataset):
if tmp_dir is not None: if tmp_dir is not None:
tmp_dir.cleanup() tmp_dir.cleanup()
if show: if show or out_dir:
self.show(results, out_dir, pipeline=pipeline) self.show(results, out_dir, pipeline=pipeline)
return results_dict return results_dict
...@@ -606,13 +606,14 @@ class NuScenesMonoDataset(CocoDataset): ...@@ -606,13 +606,14 @@ class NuScenesMonoDataset(CocoDataset):
] ]
return Compose(pipeline) return Compose(pipeline)
def show(self, results, out_dir, show=True, pipeline=None): def show(self, results, out_dir, show=False, pipeline=None):
"""Results visualization. """Results visualization.
Args: Args:
results (list[dict]): List of bounding boxes results. results (list[dict]): List of bounding boxes results.
out_dir (str): Output directory of visualization result. out_dir (str): Output directory of visualization result.
show (bool): Visualize the results online. show (bool): Whether to visualize the results online.
Default: False.
pipeline (list[dict], optional): raw data loading for showing. pipeline (list[dict], optional): raw data loading for showing.
Default: None. Default: None.
""" """
......
...@@ -350,8 +350,8 @@ class WaymoDataset(KittiDataset): ...@@ -350,8 +350,8 @@ class WaymoDataset(KittiDataset):
if tmp_dir is not None: if tmp_dir is not None:
tmp_dir.cleanup() tmp_dir.cleanup()
if show: if show or out_dir:
self.show(results, out_dir, pipeline=pipeline) self.show(results, out_dir, show=show, pipeline=pipeline)
return ap_dict return ap_dict
def bbox2result_kitti(self, def bbox2result_kitti(self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment