https://github.com/L-Sun/LGTM.git
python -m pip install --user virtualenv # install virtual environment manager
virtualenv --prompt lgtm .env # create a virtual environment named lgtm
source .env/bin/activate # activate it
Then install all dependency
pip install -r ./requirements.txt
cd third_package/HumanML3D
follow the third_package/HumanML3D/README.md to prepare original HumanML3D motion data.
Prepare pre-trained LGTM model, TMR encoders and augmented part-level annotations.
bash prepare_data_models.sh
./lgtm/utils/body_part_annotation_augmentation.py
BASE_URL = "https://api.openai.com/v1",
API_KEY = "",
Here, the API_KEY can get from your OpenAI account followed this document
Then run the following commands:
python -m prepare/body_part_annotation_augmentation
This script will use original full-body motion annotation for third_packages/TMR/datasets/annotations/humanml3d/annotations.json as input, and generate part-level motion description for each body part. The output will be saved in
third_packages/TMR/datasets/annotations/humanml3d/body_part_annotations.jsonthird_packages/TMR/datasets/annotations/body_part. body_part_annotations.json for what you want to do.
playground.ipynb notebook contains how to use LGTM to generate a motion from text. You can follow the steps in the notebook to generate a motion from text.
python -m lgtm.model.motion_diffusion fit --config configs/lgtm.yaml --trainer.max_epoch=200