Skip to main content

A web-based 3D visualization tool for 3D computer vision.

Project description

Wis3D: A web-based 3D visualization tool for 3D computer vision

Online Demo | Installation | Tutorial | Documentation

Wis3D is a web-based 3D visualization tool built for 3D computer vision researchers. You can import 3D bounding box, point clouds, meshes and feature correspondences directly from your python code and view them in your local browser. You can think of it as TensorBoard but with 3D data as the first-class citizen.

Basic Installation

Install from PyPI

pip install wis3d

or Build from source

  1. install Node.js
  2. run pip install -r requirements.txt
  3. build web pages
    cd wis3d/app
    npm install # install dependencies
    npx next build
    npx next export
    
  4. install package
    cd ../..
    python setup.py develop
    

Web Page

Quick Start

Add visualization data

# coding=utf-8
from wis3d import Wis3D
import trimesh
from PIL import Image
from transforms3d import affines, quaternions
import os
import numpy as np

wis_dir = "path_to_vis_dir"
wis3d = Wis3D(wis_dir, 'test')

# add point cloud
pcd_path = 'path_to_ply_file'
wis3d.add_point_cloud(pcd_path, name='pcd0')
pcd = trimesh.load_mesh(pcd_path)
wis3d.add_point_cloud(pcd, name='pcd1')
wis3d.add_point_cloud(pcd.vertices, pcd.colors, name='pcd2')


# add mesh
mesh_path = 'path_to_mesh_file'
wis3d.add_mesh(mesh_path, name='mesh0')
mesh = trimesh.load_mesh(mesh_path)
wis3d.add_mesh(mesh, name='mesh1')
wis3d.add_mesh(mesh.vertices, mesh.faces,
               mesh.visual.vertex_colors[:, :3], name='mesh2')

# add image
image_path = 'path_to_image_file'
wis3d.add_image(image_path, name='image0')
image = Image.open(image_path)
wis3d.add_image(image, name='image1')
wis3d.add_image(np.asarray(image), name='image2')

# add box
points = np.array([
    [-0.5, -0.5, -0.5],
    [0.5, -0.5, -0.5],
    [0.5, -0.5, 0.5],
    [-0.5, -0.5, 0.5],
    [-0.5, 0.5, -0.5],
    [0.5, 0.5, -0.5],
    [0.5, 0.5, 0.5],
    [-0.5, 0.5, 0.5]
])
wis3d.add_boxes(points, name='box0', labels='test0')
wis3d.add_boxes(points.reshape(1, 8, 3) + 0.6, name='box1', labels=['test1'])
wis3d.add_boxes([0.5, 0.2, 0.1], [1.24, 3.0, 2.1], [0.5, 0.6, 0.7], name='box2', labels='test2')
wis3d.add_boxes([[0.2, 0.6, 0.3],[0.5, 0.9, 1.0]], [[2.24, 1.0, 3.1], [0.6, 2.9, 2.1]], [[0.2, 0.5, 0.8], [0.4, 0.6, 0.8]], name='box3', labels='test3')

# add line
wis3d.add_lines(np.array([0, 0, 0]),np.array([1, 1, 1]), name='line0')
colors = np.array([[0, 255, 0], [0, 0, 255]])
wis3d.add_lines(np.array([[0, 1, 0], [0, -1, 0]]), np.array([[1, 0, 0], [1, 0, 0]]), colors, name='line1')

# add voxel
wis3d.add_voxel(np.array([[1.0, 1.0, 1.0], [-1, -1, -1]]), 0.1, np.array([[255, 255, 255], [0, 0, 0]]), name='voxel0')

# add sphere
wis3d.add_spheres(np.array([0, 0, 0]), 0.5, name='sphere0')
wis3d.add_spheres(np.array([[0, 1, 0], [0, 0, 1]]), 0.5, name = 'sphere1')
wis3d.add_spheres(np.array([[0, 1, 0], [0, 0, 1]]), np.array([0.25, 0.5]),np.array([[0, 255, 0], [0, 0, 255]]), name='sphere2')

You can also reference to examples/test.py. For more usage, see Documentation

Start the Web Server

Start the web service to view the visualization in the browser.

wis3d --vis_dir $path_to_vis_dir --host 0.0.0.0 -port 19090

Open your browser, and enter http://localhost:19090 to see the results.

Authors

Citation

@article{sun2022onepose,
    title={{OnePose}: One-Shot Object Pose Estimation without {CAD} Models},
    author = {Sun, Jiaming and Wang, Zihao and Zhang, Siyu and He, Xingyi and Zhao, Hongcheng and Zhang, Guofeng and Zhou, Xiaowei},
    journal={CVPR},
    year={2022},
}

Project details


Download files

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

Source Distribution

wis3d-1.0.1.tar.gz (576.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wis3d-1.0.1-py3-none-any.whl (584.9 kB view details)

Uploaded Python 3

File details

Details for the file wis3d-1.0.1.tar.gz.

File metadata

  • Download URL: wis3d-1.0.1.tar.gz
  • Upload date:
  • Size: 576.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for wis3d-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f34483379165c5e67d5fb231d4436ba47199d95f39dc3351d19b88c2167be277
MD5 a8937f33308f5f7b5d1e5fd7c5efbc42
BLAKE2b-256 6d93c251a32dac8804040255fb8e3df75bdbc57d66fd081b0acfb8b94695f084

See more details on using hashes here.

File details

Details for the file wis3d-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wis3d-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 584.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for wis3d-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f20d9a590ad0b2cafbbd9de444a1ec5d5b2fe04c2daa220a0ac7f5ca591846e
MD5 df78d5b729f1987909eb86bd69975e99
BLAKE2b-256 b16f1f871141feffd6380d143c5b422b7d5aad53fca1c5c63a3d5bbfc0268c8a

See more details on using hashes here.

Supported by

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