Skip to main content

Python bindings for viewercloud

Project description

pyviewercloud

pyviewercloud are the bindings to use viewercloud directly in python.

Viewercloud is a library and also a cli to read and display Pointcloud. It was initially used to display KITTI pointcloud. However it was also tested on the Lyft Level 5 Dataset pointcloud.

It will also be able to display the 3D annotations and the 3D BoundingBox computed by your favorite algorithm.

Viewercloud will open a openGL window to display the pointcloud. Press qto close.

kitti-centroid

It can also take a screen shot of the current view to save as png. Press s take screenshot.

lyft-color

Python Usage

You can install pyviewercloud the python bindings to viewercloud thanks to Pyo3 and Pyo3-numpy

poetry add pyviewercloud
pip install pyviewercloud
import numpy as np
import pyviewercloud as pyviewer

# Create a new viewer with a window size 1200x1800.
viewer = pyviewer.PointcloudViewer(1200, 1800, 15000)

# Load some pointcloud from the lyft perception dataset
# Currently only support pointcloud as numpy.ndarray Nx3 in np.float32
lyft_point_cloud_1 = np.fromfile("tests/data/lyft/host-a101_lidar0_1241893239502712366.bin", dtype=np.float32).reshape((-1, 5))[:,:3]
lyft_point_cloud_2= np.fromfile("tests/data/lyft/host-a101_lidar1_1241893239502712366.bin", dtype=np.float32).reshape((-1, 5))[:,:3]
lyft_point_cloud_3= np.fromfile("tests/data/lyft/host-a101_lidar2_1241893239502712366.bin", dtype=np.float32).reshape((-1, 5))[:,:3]

# Add them one by one to the viewer to have different color
viewer.add_pointcloud(lyft_point_cloud_1, [255, 0, 0])
viewer.add_pointcloud(lyft_point_cloud_2, [0, 0, 255])
viewer.add_pointcloud(lyft_point_cloud_3, [0, 255, 0])

# You can now display the window
viewer.show()
import numpy as np
import pyviewercloud as pyviewer

# Create a new viewer with a window size 1200x1800.
viewer = pyviewer.PointcloudViewer(1200, 1800, 15000)

# Load some pointcloud from the kitti dataset
kitti_point_cloud = np.fromfile("tests/data/kitti/velodyne/000001.bin", dtype=np.float32).reshape((-1, 4))[:,:3]
viewer.add_pointcloud(kitti_point_cloud, [255, 255, 255])

# Add some centroids to have the same color.
# Currently only support centroids as numpy.ndarray Nx3 in np.float32
centroids = np.array([[-11.5,0,-0.8]]).astype(np.float32)
viewer.add_centroid(centroids, [255, 0, 0])
viewer.show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyviewercloud-0.2.1-cp39-cp39-macosx_10_7_x86_64.whl (610.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

pyviewercloud-0.2.1-cp38-cp38-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8

pyviewercloud-0.2.1-cp38-cp38-macosx_10_7_x86_64.whl (610.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

pyviewercloud-0.2.1-cp37-cp37m-macosx_10_7_x86_64.whl (610.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

pyviewercloud-0.2.1-cp36-cp36m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m

pyviewercloud-0.2.1-cp36-cp36m-macosx_10_7_x86_64.whl (610.3 kB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page