GithubHelp home page GithubHelp logo

bvh2smpl's Introduction

BVH2SMPL

Usage

Install the dependencies:

conda create -n animation python=3.10.12
pip install -r requirements.txt

Download model:

Goto SMPL

Download this one: [Download version 1.0.0 for Python 2.7 (female/male. 10 shape PCs)

Rename the neutral model into SMPL_NEUTRAL.pkl and put it into ./src/rendering_utils/smpl

Goto soruce code folder:

cd ./src

Run the script:

  1. Put the bvh files into ./bvh folder, then run script to preprocessing the files.

    To get the trajectory ends at the origin, I calculate the Y rotation of the root point at the last frame, then cast the inverse Y-rotation to the root rotation and root translation of all frames.

    You'll have to find out the time window the people is about to sit (put the bvh into blender and find a proper frame), and put the frame upper and lower range into the script.

    python preprocess.py
  2. Run the script to retarget the motion

    python retargeting.py
  3. Run the script to render the result

    note: in this part you must have cuda.

    python rendering.py
  4. run the script to generate the video

    Goto ./results-objs folder, then create a blender file, click on the bottom left, choose Text Editor , then click new to create a new script, paste ./results-objs/script-objs_to_animation-in_blender.py and run it. Like the picture.

    CleanShot 2024-03-10 at 06.32.14@2x

    Then click the Output , choose 60fps (derived from the bvh), choose the output folder, choose the File Format as FFmpeg Video .

    CleanShot 2024-03-10 at 06.31.45@2x

    Then click Render โ†’ Render Animation , wait for some time and you will get your video in the output folder.

    CleanShot 2024-03-10 at 06.33.57@2x

Goal

I propose an end-to-end method to convert bvh file to SMPL mesh representation.

And you can also simply modify the retargeting.py file to fit another bvh hierarchy.

Results

Goto ./results-animation folder to see more results.

Quotation

Code of step 3 is mostly from motion-diffusion-model

Epilogue

If you want to know how I complete this work, you may go to Epilogue.md to check it out.

bvh2smpl's People

Contributors

emptybluebox avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.