3d-object-vis
3d-object-vis copied to clipboard
This repository is based on 3D-Detection-Tracking-Viewer. But modified slightly for 2 purposes:
- Easier to save visualization pictures with configurable scale
- Add
offscreenparam inViewer - Add
save_name & scaleinViewer.show_3D
- Add
- Set the camera position at my own preferences
- Change
self.vi.show(camera)settings inViewer.show_3D
- Change
Usage
Requirement
- You need to
pip install vedoto visualize your prediction. For more details, please refere to 3D-Detection-Tracking-Viewer. - You need to
pip install tqdmto show the progress bar. - You need to
pip install opencv-pythonto concat 3D & 2D images.
Data
You can organize your data like this, just like KITTI
- data_root
- velodyne
- image_2
Scripts
Main function is in vis.py. Most of the funcionalities are commented, and some were written in Chinese, but overall it's easy to read. Please check the scripts in vis.py after if __name__ == '__main__': to see the basic usage.
You can also easily start with the codes below
from viewer.viewer import Viewer
def build_viewer(box_type="OpenPCDet", bg=(255,255,255), offscreen=False):
return Viewer(box_type=box_type, bg=bg, offscreen=offscreen)
vi = build_viewer()
vi.add_points(points) # (N, 3), (x, y, z)
vi.add_3D_boxes(boxes) # (N, 7), (x, y, z, w, h, l, theta)
vi.show_3D()
If you want to visualize your prediction results, you can get your inference results result.pkl by running with OpenPCDet project. OR you can try inference.py provided in this repo, which is also built on OpenPCDet demo.py.
python inference.py --cfg_file {CONFIG_FILE} \
--ckpt {CKPT} \
--data_path {POINT_CLOUD_DATA}
Demo
I've made some demo videos to show the results: