Skip to content

Python framework for motion data manipulation & visualization

Notifications You must be signed in to change notification settings

seokhyeonhong/aPyOpenGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Framework for Motion Data

aPyOpenGL is a Python version framework of aOpenGL for motion data processing and visualization. Our framework is based on right-hand coordinate with y-axis as the up vector.

Installation

Linux

For Linux users, we provide a shell script that creates a conda environment in install.sh. You can modify the environment name by changing ENV_NAME in the script, which is set to env-apyopengl by default.

bash install.sh

Windows

For the visualization modules, install necessary modules first.

pip install -r requirements.txt
imageio_download_bin freeimage

Also, visit this perfect guide to install FBX SDK on your computer: Link for Windows

How to use

aPyOpenGL has four main modules agl, kin, transforms, and ops, and one additional auxiliary module utils. Example codes are in examples and you can run the code you want through:

python examples/{script_to_run}.py

Set Up the Environment Variable

If you add the path of this framework to the global environment variable, you can use this framework anywhere in your local computer.

Linux

Add this line to ~/.bashrc:

export PYTHONPATH=$PYTHONPATH:{path/to/aPyOpenGL}

and then execute this:

source ~/.bashrc

Windows

Add the path of the cloned repository to the environment variable PYTHONPATH. If you don't know how, please refer to this.

Commands

  • F1: Render the scene in GL_FILL mode.
  • F2: Render the scene in GL_LINE mode.
  • F5: Capture the screen in image and save in captures/yyyy-mm-dd/images.
  • F6: Capture the screen in video if entered once, and save in captures/yyyy-mm-dd/videos if entered again.
  • Alt + Left Mouse: Tumble tool for the camera.
  • Alt + Middle Mouse: Track tool for the camera.
  • Alt + Mouse Scroll: Dolly tool for the camera.
  • Mouse Scroll: Zoom tool for the camera.
  • A: Switch the visualization of the axis.
  • G: Switch the visualization of the grid.
  • F: Switch the visualization of the render fps text.
  • Left / Right arrow: Move 1 second to the past / future.

Additionally, you can add your own custom commands. You can find the examples in the codes in examples.

Motion

We provide BVH parser for motion data and FBX parser for both motion and mesh data. Motion data in this framework is basically structred by hierarchy of Joint, Skeleton, Pose, and Motion, and you can see the structure here.

Transforms

transforms provides several operations for transformation in both numpy and pytorch. Modules that start with n_ indicates that it's for numpy ndarray, and t_ indicates pytorch tensor.

Utils

utils provides several utility functions like multiprocessing.

More to Come

We are planning to support motion manipulation functions, like kin namespace in aOpenGL. This will be updated soon!

Acknowledgements

The overall structure of the rendering modules is inspired by aOpenGL and LearnOpenGL

Data processing, operation functions, and utility functions are inspired by fairmotion, pytorch3d, PFNN, and LaFAN1 repositories

About

Python framework for motion data manipulation & visualization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published