Skip to content

nv-nguyen/bop_viz_kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BOP visualization kit

A simple Python package to visualize 6D pose for BOP benchmark

To install bop_viz_kit, run:

git clone https://github.com/nv-nguyen/bop_viz_kit.git
pip install -e bop_viz_kit

Usage

Note that object's poses should be defined in OpenCV coordinate frame (same as BOP benchmark)

  1. Visualize 3D bounding box
import bop_viz_kit as bop_viz
mesh = bop_viz.load_mesh(mesh_path)
bbox = bop_viz.get_bbox_from_mesh(mesh)# computing 3D box from mesh
img = bop_viz.draw_bounding_box(
    img, obj_pose, bbox, intrinsic, color, thickness=2,
)
  1. Visualize coordinate frame
import bop_viz_kit as bop_viz
length_coordinate_frame = 0.3 # in same scale as mesh
img = bop_viz.draw_pose_axis(
    img, obj_pose, length_coordinate_frame, intrinsic, thickness=2
)
  1. Visualize projection of point cloud
import bop_viz_kit as bop_viz
mesh = bop_viz.load_mesh(mesh_path)
img = bop_viz.draw_point_cloud(
    img, mesh, intrinsic, obj_pose, color, number_points=500,
)
  1. Visualize contour (by rendering cad through pyrender)
import bop_viz_kit as bop_viz
mesh = bop_viz.load_mesh(mesh_path)
depth, img = bop_viz.draw_pose_contour(
    img, mesh intrinsic, obj_pose, color, thickness=5, headless=False
) # set headless=True when running on headless system
  1. Visualize interactively, please checkout the demo vis_interactive.py

TODO

  • Blended visualization with alpha channel
  • Omni3D's bounding box visualization (BOP+ScanNet)
  • Simple script to render CAD with BlenderProc
  • Script to generate template poses as done in template-pose
  • Script to visualize camera and object interatively

About

Visualization kit for BOP benchmark

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages