Package: point-viz
IntroductionPoint-viz is a light-weight, out-of-box point cloud visualizer working in browser, it is built onThree.jsand has python API. Bounding box (bbox) visualization is supported and here is anexample.
Point-viz does not need Internet connection to work (but the installation needs, of course),
and it has been tested on Chrome and Safari with both python 2 and 3.The main motivation of this visualizer is to allow user to visualize point cloud data from remote server easily.Tested Environmentpython==3.7numpy==1.18.5Browsers: Google Chrome, Safari, FirefoxUsageTo install point-viz, simply run:pip install point-viz, and that's all.Below is the template of its python API:# Import package.
from point_viz import PointvizConverter

# Initialize and setup output directory.
Converter = PointvizConverter(home)
# Pass data and create html files.
Converter.compile(task_name, coors, default_rgb, intensity, bbox_params, bbox_color)Below is a more specific (partial) example that is demonstrated on KITTI dataset.save_viz_path = /path/to/save/visualization/

Converter = PointvizConverter(save_viz_path)

...

# note the pts_inputs are in z-up system
# which in kittidataset, it should be in 
# velodyne coordinates
pts_inputs = kitti_dataset.get_sample(1)

...

gt_bbox_params_list = []

# the labels are in z-up system
# which in kittidataset, it should be in 
# velodyne coordinates
for obj in kitti_dataset.get_labels(1):
    bbox_params_list = [obj.l, # along y axis
                        obj.h, # along z axis
                        obj.w, # along x axis
                        obj.y,
                        obj.z,
                        obj.x,
                        obj.ry] 
                        # in l, h, w, y, z, x
                        # since the coordinate system in three.js is y-up
    gt_bbox_params_list.append(bbox_params_list)

# if you want to generate visualizations for multiple samples
# you have to call this function compile in a loop
Converter.compile("sample_{}".format(1), coors=pts_input[:,:3],         intensity=pts_input[:,[1,2,0]], bbox_params=gt_bbox_params_list)In the example above you find the following directory architectures being generated:/path/to/save/visualization/datasample_1_bbox.csv (if bbox_params is not None during compilation)sample_1_pc.bin (numpy binary files that contains x, y, z, r, g, b)... (more if you compile multiple times)htmlsample_1.html... (more if you compile multiple times)srccontaining the dependencies that html requiresIn your remote server,cd /path/to/save/visualization/. Then runpython3 -m http.server 8000.To access the visualization locally, go to the urlhttp://<ip_address_of_the_remote_server>:8000Variables ExplanationThe*means optional.home: The directory where to put output html files, must be given.task_name*:string, name of the output html file (can be overwritten if the name already exists; default value is "default").coors*:2-D float array, the x, y and z coordinates of each point in the point cloud.default_rgb*:2-D float/int arrayof the same length ascoors, the R, G and B colors of each point.
If not provided, the RGB will be automatically calculated based onintensity(if given) or
point coordinates (whenintensityis also missing).intensity*:1-D float arrayof the same length ascoors, the intensity of each point. It only takes effect whendefault_rgbis not given.bbox_params*:2-D list, the geometry parameters of each bbox. Attributes of each row should be arranged as follows:Attribute #Description0Length (float, dimension along x-axis)1Height (float, dimension along y-axis)2Width (float, dimension along z-axis)3X coordinate of bbox centroid  (float)4Y coordinate of bbox centroid  (float)5Z coordinate of bbox centroid  (float)6Horizontal rotation regarding the +x-axis in radians (float)7*Color of the bbox (string, optional;X11 color nameis supported, default is "Magenta")8*Label text of the bbox (string, optional)bbox_color*:boolean, default isTrue. If the color of bbox is missing while the label text is given, thenbbox_colorhas to be explicitly set toFalse.