To use the AMASS dataset, you need to download and set up the required data and models. This includes specifying the storage paths for the AMASS dataset and SMPL-H models and ensuring the dependencies are installed. Follow the instructions below to complete the setup.
Note
this currently works only with editable installations!
The retargeting pipeline builds on the SMPL models, which require PyTorch. It is recommended to install the CPU version of PyTorch to avoid conflicts with JAX.
To install the CPU version of PyTorch, run:
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
Once PyTorch is installed, you can install the rest of the additional dependencies, including SMPL-related packages. Note that this will install the GPU version of PyTorch if you haven't explicitly installed the CPU version above:
pip install -e '.[smpl]'
Before downloading the datasets and models, specify the directory where you’d like to store them:
mkdir <path to folder storing the amass datasets>
loco-mujoco-set-amass-path --path <path to folder storing the amass datasets>
mkdir <path to folder storing the smpl models>
loco-mujoco-set-smpl-model-path --path <path to folder storing the smpl models>
For example, to install the datasets in your home folder, you can run:
mkdir $HOME/amass
loco-mujoco-set-amass-path --path $HOME/amass
mkdir $HOME/smpl
loco-mujoco-set-smpl-model-path --path $HOME/smpl
Also, set the path to which the converted datasets (after retargeting) will be stored. If you already specified
a general caching directory for LocoMuJoCo using loco-mujoco-set-all-caches
, you can skip this step. But if you want
to store the converted AMASS datasets in a different directory, you can set it using:
loco-mujoco-set-conv-amass-path --path <path to converted amass data>
For example, to set the path into the home directory, you can run:
loco-mujoco-set-conv-amass-path --path $HOME/amass_conv
- Visit the AMASS website.
- Register and download the datasets you wish to use.
- Select the
SMPL-H G
version of each dataset. - Extract and place them in the directory specified above, e.g.,
$HOME/amass
.
- Go to the MANO website.
- Register and download the following:
- Extended SMPL+H model (includes the SMPL-H model w/o hands).
- Models & Code (includes the hand models).
- Extract and place them in the directory specified above, e.g.,
$HOME/smpl
.
To combine the body and hand models into a single SMPLH_NEUTRAL.PKL
file, follow one of the methods below:
To resolve dependency issues with deprecated packages, we provide an automated script. This script uses a Conda environment to manage dependencies and ensure proper installation.
- Ensure Anaconda is installed.
- Copy and paste the script somewhere.
- Run the script:
chmod u+x install_smplh.sh # this is using the original name of the script ./install_smplh.sh
This script will:
- Create a Python 3.10 environment.
- Install all required dependencies.
- Generate the
SMPLH_NEUTRAL.PKL
file and place it in/path/to/smpl/models
. - Finally, delete the created Python environment and dependencies.
If you don’t have Conda installed or prefer a manual setup, follow these steps. This method only supports Python 3.10.
-
Create a Virtual Environment:
python3.10 -m venv smplh_model_conversion_env source smplh_model_conversion_env/bin/activate # On Windows: smplh_model_conversion_env\Scripts\activate
-
Install Required Dependencies:
pip install 'numpy<1.23.0' chumpy tqdm pyyaml
-
Run the Script:
cd path/to/loco-mujoco python loco_mujoco/smpl/generate_smplh_model.py --smpl-conf-file loco_mujoco/smpl/conf_paths.yaml
-
Deactivate the Environment:
deactivate
You can test the SMPL model by running the script in examples/replay_datasets/
:
python smpl_example.py
WARNING! The script assumes that you have downloaded the DanceDB
dataset. You can try the script with different datasets by specifying a different dataset file