Skip to main content

Viewing and rendering of sequences of 3D data.

Project description

AITV AITViewer

A set of tools to visualize and interact with sequences of 3D data with cross-platform support on Windows, Linux, and Mac OS X.

AITV Sample

Features

  • Easy to use Python interface.
  • Load SMPL[-H | -X] / MANO / FLAME sequences and display them in an interactive viewer.
  • Support for the STAR model.
  • Manually editable SMPL sequences.
  • Render 3D data on top of images via weak-perspective or OpenCV camera models.
  • Built-in extensible GUI (based on Dear ImGui).
  • Export the scene to a video (mp4/gif) via the GUI or render videos/images in headless mode.
  • Animatable camera paths.
  • Prebuilt renderable primitives (cylinders, spheres, point clouds, etc).
  • Support live data feeds and rendering (e.g., webcam).
  • Modern OpenGL shader-based rendering pipeline for high performance (via ModernGL / ModernGL Window).

https://user-images.githubusercontent.com/5639197/188625409-1c86b12e-4e91-48ba-ab7e-b050508d586b.mp4

AITV SMPL Editing

Installation

Basic Installation:

pip install aitviewer

Or install locally (if you need to extend or modify code)

git clone git@github.com:eth-ait/aitviewer.git
cd aitviewer
pip install -e .

Note that this does not install the GPU-version of PyTorch automatically. If your environment already contains it, you should be good to go, otherwise install it manually.

If you would like to visualize STAR, please install the package manually via

pip install git+https://github.com/ahmedosman/STAR.git

and download the respective body models from the official website.

Configuration

The viewer loads default configuration parameters from aitvconfig.yaml. There are three ways how to override these parameters:

  • Create a file named aitvconfig.yaml and have the environment variable AITVRC point to it. Alternatively, you can point AITVRC to the directory containing aitvconfig.yaml.
  • Create a file named aitvconfig.yaml in your current working directory, i.e. from where you launch your python program.
  • Pass a config parameter to the Viewer constructor.

Note that the configuration files are loaded in this order, i.e. the config file in your working directory overrides all previous parameters.

The configuration management is using OmegaConf. You will probably want to override the following parameters at your convenience:

  • datasets.amass: where AMASS is stored if you want to load AMASS sequences.
  • smplx_models: where SMPLX models are stored, preprocessed as required by the smplx package.
  • star_models: where the STAR model is stored if you want to use it.
  • export_dir: where videos and other outputs are stored by default.

Quickstart

Display the SMPL T-pose:

from aitviewer.renderables.smpl import SMPLSequence
from aitviewer.viewer import Viewer

if __name__ == '__main__':
    v = Viewer()
    v.scene.add(SMPLSequence.t_pose())
    v.run()

Examples

Check out the examples for a few examples how to use the viewer:

  • animation.py: Example of how 3D primitives can be animated.

  • camera_path.py: Example how to use camera paths.

  • headless_rendering.py: Example how to render a video in headless mode.

  • load_3DPW.py: Loads an SMPL sequence from the 3DPW dataset and displays it in the viewer.

  • load_AMASS.py: Loads an SMPL sequence from the AMASS dataset and displays it in the viewer.

  • load_DIP.py: Loads an SMPL and IMU sequence taken from the TotalCapture dataset as used by DIP.

  • load_GLAMR.py: Loads a result obtained from GLAMR and displays it in the viewer both for 3D and 2D inspection.

  • load_obj.py: Loads meshes from OBJ files.

  • load_ROMP.py: Loads the result of ROMP and overlays it on top of the input image using the OpenCV camera model.

  • load_template.py: Loads the template meshes of SMPL-H, MANO, and FLAME.

  • load_VIBE.py: Loads the result of VIBE and overlays it on top of the input image.

  • missing_frames.py: Example how sequences with intermittent missing frames can be visualized.

  • quickstart.py: The above quickstart example.

  • render_primitives.py: Renders a bunch of spheres and lines.

  • stream.py: Streams your webcam into the viewer.

  • vertex_clicking.py: An example how to subclass the basic Viewer class for custom interaction.

Keyboard shortcuts

The viewer supports the following keyboard shortcuts, all of this functionality is also accessible from the menus and windows in the GUI. This list can be shown directly in the viewer by clicking on the Help -> Keyboard shortcuts menu.

  • SPACE Start/stop playing animation.
  • . Go to next frame.
  • , Go to previous frame.
  • G Open a window to change frame by typing the frame number.
  • X Center view on the selected object.
  • O Enable/disable orthographic camera.
  • T Show the camera target in the scene.
  • C Save the camera position and orientation to disk.
  • L Load the camera position and orientation from disk.
  • K Lock the selection to the currently selected object.
  • S Show/hide shadows.
  • D Enabled/disable dark mode.
  • P Save a screenshot to the the export/screenshots directory.
  • I Change the viewer mode to inspect.
  • V Change the viewer mode to view.
  • E If a mesh is selected, show the edges of the mesh.
  • F If a mesh is selected, switch between flat and smooth shading.
  • Z Show a debug visualization of the object IDs.
  • ESC Exit the viewer.

Projects using the AITViewer

The following projects have used the AITViewer:

Citation

If you use this software, please cite it as below.

@software{Kaufmann_Vechev_AITViewer_2022,
  author = {Kaufmann, Manuel and Vechev, Velko and Mylonopoulos, Dario},
  doi = {10.5281/zenodo.1234},
  month = {7},
  title = {{AITViewer}},
  url = {https://github.com/eth-ait/aitviewer},
  year = {2022}
}

Contact & Contributions

This software was developed by Manuel Kaufmann, Velko Vechev and Dario Mylonopoulos. For questions please create an issue. We welcome and encourage module and feature contributions from the community.

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

aitviewer-1.6.1.tar.gz (167.9 kB view details)

Uploaded Source

Built Distribution

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

aitviewer-1.6.1-py3-none-any.whl (204.1 kB view details)

Uploaded Python 3

File details

Details for the file aitviewer-1.6.1.tar.gz.

File metadata

  • Download URL: aitviewer-1.6.1.tar.gz
  • Upload date:
  • Size: 167.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.11

File hashes

Hashes for aitviewer-1.6.1.tar.gz
Algorithm Hash digest
SHA256 923e902552418417c8295f39cc0628e70ddb841152b6dbefb8624be2e924cf82
MD5 8cd36d150378fb4313fb1b32a5cbf627
BLAKE2b-256 9b0eba863c64b737c32f834587230bd5b566a07639fb7b62603cb587c73e7e6c

See more details on using hashes here.

File details

Details for the file aitviewer-1.6.1-py3-none-any.whl.

File metadata

  • Download URL: aitviewer-1.6.1-py3-none-any.whl
  • Upload date:
  • Size: 204.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.11

File hashes

Hashes for aitviewer-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f64dc8040ed3a6c058602c05ca9e75bd00a9339c9fd624c66bc4363f61e4691f
MD5 df452cd15e57ba280877cc7eb799321f
BLAKE2b-256 40b2eb6e234ffb840fa3579db360c935226485025d395e1faac13b06e21f5b37

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