As you can see below, these procedures are rather complicated with a lot of steps, and have only been tested with the exact version of packages below. Thus, we have computed and provided an asset bank using the methods below to animate 100+ pedestrian sequences. It is highly recommended to use that instead. Link to download is in the main README.
For scientific research purpose only bounded by license: https://smpl-x.is.tue.mpg.de/modellicense
This already assumes that you have successfly ran AvatarClip, and have obtained some meshes that you wish to animate. Please follow their instruction to generate the .ply
files. (their Colab example is really useful!)
-
Install Blender, only tested with Blender 3.6 LTS
sudo snap install blender --channel=3.6lts/stable --classic
-
Set up Conda environment as below:
conda create -n smpl python=3.6 conda activate smpl conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit==10.1.243 -c pytorch conda install tqdm pip install 'smplx[all]' pip install chumpy pip install open3d
-
Install Python FBX SDK
- Go to https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-3
- Download the hyperlink that says
Linux FBX SDK 2020.3.2 Python (gz - 5057Kb)
- Unzip the downloaded file and follow the instructions in
Install_FbxSdk.txt
-
Modify FBX import paths
- Edit
export_fbx.py
andfbx_utils.py
with the FBX path you just extracted:sys.path.append('/path/to/fbxsdk/FBX202031_FBXPYTHONSDK_LINUX/lib/Python37_x64')
- Edit
-
Download SMPL model
- Download the SMPl models (
version 1.1.0 for Python 2.7 (female/male/neutral, 300 shape PCs
) and place it as followsanim_ped/ ├── ... └── smpl_models/ └── smpl/ ├── SMPL_FEMALE.pkl ├── SMPL_MALE.pkl └── SMPL_NEUTRAL.pkl
- Download the SMPl models (
- Make sure that your
.ply
files (which are outputs of AvatarClip), are placed at theply_files/
folder - Run
python export_fbx.py
, which will automatically rig the model and save the exported FBX Binary files tofbx_files/
Note: we only upload one mesh to Mixamo to get their animation that we can then apply to other meshes automatically.
-
Register for Mixamo, search for and choose the Walking animation, and upload one random model in
fbx_files/
-
Download the animated model with these options:
- Format: FBX binary
- Skin: with skin
- Frames per Second: 30
- Keyframe Reduction: uniform
-
Move the downloaded FBX file to
animation/
- Before running the scripts, make sure your folder structure is like this
anim_ped/ ├── ... ├── animation/ │ └── animated.fbx └── fbx_files/ ├── mesh_1.fbx └── ...
- Run the Blender script with the following command. Ignore the "Error" that pops up in the terminal.
blender -b -P script.py
- The animated
.obj
sequences will be saved inoutputs/
, where each subfolder contains 30.obj
files. You can move all the subfolders ofoutputs/
tolidardm/generated_assets/pedestrian
withmv -t /path/to/lidardm/generated_assets/pedestrian outputs/*
This script is built on top of Avatar2FBX
folder of AvatarClip, which is based on Smplx2FBX. Thank the authors of both repositories for the awesome open-source projects!