Convert .bvh files (Biovision Hierarchy) to DeepMimic format.
The DeepMimic project currently offers no way to import custom reference motions. This is shown in DeepMimic issue #23. This project aims to transfer animation data from .BVH files into DeepMimic motion files. Motion files can then be used to train DeepMimic skills. Many thanks to user SleepingFox88 for starting off the project. Original repository can be found here. This repository currently works well with this database.
pip install bvhtodeepmimic
pip3 install bvhtodeepmimic
Will install the library together with the requirements. Currently works with python 3.6 or 3.7
Create a BvhConverter object:
from bvhtomimic import BvhConverter converter = BvhConverter("./Settings/settings.json")
Generate the DeepMimic text from a .bvh file:
Or write directly to file:
Or use the example script that will convert all .bvh files located in ./InputBvh/ into Mimic Motion files, located in ./OutputMimic/ .
(GIF has been generated using this mocap file from this database.)
Watch more videos of recorded conversions here.
Creating a settings file
Currently joints in .bvh files have to be manually assigned by name to the corresponding joints in the DeepMimic humanoid model. This is done by assigning the .bvh model's bone names to the corresponding joint properties in ./Settings/settings.json. On top of the joint assignments, this file should also include settings to change the scale by which the .bvh file should be transformed, and the joints used to identify the root rotation of the model.
This code has been developed within the ACRO research group.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.