While verifying the inference demo according to the following code in Get Started, we often find that the open3d library can visualize the point cloud and detection results, but after closing the visualization window, the results are not saved to the image (the image is often completely black). To fix this issue we raised this PR.
We modify the show() function in the mmdet3d/visualization/local_visualizer.py file.
We annotate self.o3d_vis.clear_geometries() in line 887, because geometries should not be cleared before saving as an image.
We modify self.o3d_vis.capture_screen_image(save_path) in line 896 to self.o3d_vis.capture_screen_image(save_path, do_render=True), because we need to re-render after manually closing the visualization window to ensure that the stored image is not empty.
After our modification, the visualization results can be saved to the image normally.
Motivation
While verifying the inference demo according to the following code in Get Started, we often find that the open3d library can visualize the point cloud and detection results, but after closing the visualization window, the results are not saved to the image (the image is often completely black). To fix this issue we raised this PR.
Code:
Visualize window:
Saved image (before modification):
Modification
We modify the
show()
function in the mmdet3d/visualization/local_visualizer.py file.self.o3d_vis.clear_geometries()
in line 887, because geometries should not be cleared before saving as an image.self.o3d_vis.capture_screen_image(save_path)
in line 896 toself.o3d_vis.capture_screen_image(save_path, do_render=True)
, because we need to re-render after manually closing the visualization window to ensure that the stored image is not empty.After our modification, the visualization results can be saved to the image normally.
Saved image (after modification):