# Motion VQ-Trans Pytorch implementation of paper "Generating Human Motion from Textual Descriptions with High Quality Discrete Representation" [[Notebook Demo]](https://colab.research.google.com/drive/1tAHlmcpKcjg_zZrqKku7AfpqdVAIFrF8?usp=sharing) ![teaser](img/Teaser.png) If our project is helpful for your research, please consider citing : (todo) ``` @inproceedings{shen2020ransac, title={RANSAC-Flow: generic two-stage image alignment}, author={Shen, Xi and Darmon, Fran{\c{c}}ois and Efros, Alexei A and Aubry, Mathieu}, booktitle={16th European Conference on Computer Vision} year={2020} } ``` ## Table of Content * [1. Visual Results](#1-visual-results) * [2. Installation](#2-installation) * [3. Quick Start](#3-quick-start) * [4. Train](#4-train) * [5. Evaluation](#5-evaluation) * [6. Motion Render](#6-motion-render) * [7. Acknowledgement](#7-acknowledgement) * [8. ChangLog](#8-changlog) ## 1. Visual Results (More results can be found in our project page (todo)) ![visualization](img/ALLvis.png) ## 2. Installation ### 2.1. Environment Our model can be learnt in a **single GPU V100-32G** ```bash conda env create -f environment.yml conda activate VQTrans ``` The code was tested on Python 3.8 and PyTorch 1.8.1. ### 2.2. Dependencies ```bash bash dataset/prepare/download_glove.sh ``` ### 2.3. Datasets We are using two 3D human motion-language dataset: HumanML3D and KIT-ML. For both datasets, you could find the details as well as download link [[here]](https://github.com/EricGuo5513/HumanML3D). Take HumanML3D for an example, the file directory should look like this: ``` ./dataset/HumanML3D/ ├── new_joint_vecs/ ├── texts/ ├── Mean.npy # same as in [HumanML3D](https://github.com/EricGuo5513/HumanML3D) ├── Std.npy # same as in [HumanML3D](https://github.com/EricGuo5513/HumanML3D) ├── train.txt ├── val.txt ├── test.txt ├── train_val.txt └──all.txt ``` ### 2.4. Motion & text feature extractors: We use the same extractors provided by [t2m](https://github.com/EricGuo5513/text-to-motion) to evaluate our generated motions. Please download the extractors. ```bash bash dataset/prepare/download_extractor.sh ``` ### 2.5. Pre-trained models The pretrained model files will be stored in the 'pretrained' folder: ```bash bash dataset/prepare/download_model.sh ``` ### 2.6. Render motion (optional) If you want to render the generated motion, you need to install: ```bash sudo sh dataset/prepare/download_smpl.sh conda install -c menpo osmesa conda install h5py conda install -c conda-forge shapely pyrender trimesh mapbox_earcut ``` ## 3. Quick Start A quick start guide of how to use our code is available in [demo.ipynb](https://colab.research.google.com/drive/1tAHlmcpKcjg_zZrqKku7AfpqdVAIFrF8?usp=sharing)
## 4. Train Note that, for kit dataset, just need to set '--dataname kit'. ### 4.1. VQ-VAE The results are saved in the folder output_vqfinal.