|
| 1 | +# Model parameter transfer |
| 2 | + |
| 3 | +## Table of Contents |
| 4 | + * [License](#license) |
| 5 | + * [Description](#description) |
| 6 | + * [Using the code](#using-the-code) |
| 7 | + * [Data](#data) |
| 8 | + * [SMPL to SMPL-X](#smpl-to-smpl-x) |
| 9 | + * [SMPL-X to SMPL](#smpl-x-to-smpl) |
| 10 | + * [SMPL+H to SMPL](#smpl%2Bh-to-smpl) |
| 11 | + * [SMPL to SMPL+H](#smpl-to-smpl%2Bh) |
| 12 | + * [SMPL+H to SMPL-X](#smpl%2Bh-to-smpl-x) |
| 13 | + * [SMPL-X to SMPL+H](#smpl-x-to-smpl%2Bh) |
| 14 | + * [Visualize correspondences](visualize-correspondences) |
| 15 | + * [Citation](#citation) |
| 16 | + * [Acknowledgments](#acknowledgments) |
| 17 | + * [Contact](#contact) |
| 18 | + |
| 19 | +## License |
| 20 | + |
| 21 | +Software Copyright License for **non-commercial scientific research purposes**. |
| 22 | +Please read carefully the [terms and conditions](https://github.com/vchoutas/smplx/blob/master/LICENSE) and any accompanying documentation before you download and/or use the SMPL-X/SMPLify-X model, data and software, (the "Model & Software"), including 3D meshes, blend weights, blend shapes, textures, software, scripts, and animations. By downloading and/or using the Model & Software (including downloading, cloning, installing, and any other use of this github repository), you acknowledge that you have read these terms and conditions, understand them, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Model & Software. Any infringement of the terms of this agreement will automatically terminate your rights under this [License](./LICENSE). |
| 23 | + |
| 24 | +## Description |
| 25 | + |
| 26 | +The repository contains code for converting model parameters of one model to |
| 27 | +another. **Never** copy parameters between the models. You will not get the |
| 28 | +same poses. SMPL, SMPL+H and SMPL-X shape spaces are **NOT** compatible, since |
| 29 | +each model is the result of a different training process. |
| 30 | +A more detailed explanation on how we extract correspondences |
| 31 | +between the models and the loss function used to estimate the parameters can be |
| 32 | +found [here](./docs/transfer.md). |
| 33 | + |
| 34 | +## Requirements |
| 35 | + |
| 36 | +1. Start by cloning the SMPL-X repo: |
| 37 | +```Shell |
| 38 | +git clone https://github.com/vchoutas/smplx.git |
| 39 | +``` |
| 40 | +2. Run the following command to install all necessary requirements |
| 41 | +```Shell |
| 42 | + pip install -r requirements.txt |
| 43 | +``` |
| 44 | +3. Install the Torch Trust Region optimizer by following the instructions [here](https://github.com/vchoutas/torch-trust-ncg). |
| 45 | + |
| 46 | + |
| 47 | +## Using the code |
| 48 | + |
| 49 | +### Data |
| 50 | + |
| 51 | +Register on the [SMPL-X website](http://smpl-x.is.tue.mpg.de/), go to the |
| 52 | +downloads section to get the correspondences and sample data, |
| 53 | +by clicking on the *Model correspondences* button. |
| 54 | +Create a folder |
| 55 | +named `transfer_data` and extract the downloaded zip there. You should have the |
| 56 | +following folder structure now: |
| 57 | + |
| 58 | +```bash |
| 59 | +transfer_data |
| 60 | +├── meshes |
| 61 | +│ ├── smpl |
| 62 | +│ ├── smplx |
| 63 | +├── smpl2smplh_def_transfer.pkl |
| 64 | +├── smpl2smplx_deftrafo_setup.pkl |
| 65 | +├── smplh2smpl_def_transfer.pkl |
| 66 | +├── smplh2smplx_deftrafo_setup.pkl |
| 67 | +├── smplx2smpl_deftrafo_setup.pkl |
| 68 | +├── smplx2smplh_deftrafo_setup.pkl |
| 69 | +├── smplx_mask_ids.npy |
| 70 | +``` |
| 71 | + |
| 72 | +### SMPL to SMPL-X |
| 73 | + |
| 74 | +To run the code to convert SMPL meshes to SMPL-X parameters use the following command: |
| 75 | + ```Shell |
| 76 | + python main.py --exp-cfg config_files/smpl2smplx.yaml |
| 77 | + ``` |
| 78 | + |
| 79 | +The file *smpl2smplx.yaml* contains a sample configuration that reads meshes from a folder, |
| 80 | +processes them and returns pkl files with SMPL-X parameters. To run on your own data create a folder |
| 81 | +with SMPL meshes, in either ply or obj format, change the path in the config file and run the code. |
| 82 | + |
| 83 | +### SMPL-X to SMPL |
| 84 | + |
| 85 | +To run the code to convert SMPL-X meshes to SMPL parameters use the following command: |
| 86 | + ```Shell |
| 87 | + python main.py --exp-cfg config_files/smplx2smpl.yaml |
| 88 | + ``` |
| 89 | + |
| 90 | +The file *smplx2smpl.yaml* contains a sample configuration that reads meshes from a folder, |
| 91 | +processes them and returns pkl files with SMPL parameters. To run on your own data create a folder |
| 92 | +with SMPL-X meshes, in either ply or obj format, change the path in the config file and run the code. |
| 93 | +When creating the SMPL-X meshes, do not use the hand and face parameters. |
| 94 | +Naturally, you will lose all hand and face information if you choose this, since |
| 95 | +SMPL cannot model them. |
| 96 | + |
| 97 | + |
| 98 | +### SMPL+H to SMPL |
| 99 | + |
| 100 | +To run the code to convert SMPL+H meshes to SMPL parameters use the following command: |
| 101 | + ```Shell |
| 102 | + python main.py --exp-cfg config_files/smplh2smpl.yaml |
| 103 | + ``` |
| 104 | + |
| 105 | +The file *smplh2smpl.yaml* contains a sample configuration that reads meshes from a folder, |
| 106 | +processes them and returns pkl files with SMPL parameters. To run on your own data create a folder |
| 107 | +with SMPL+H meshes, in either ply or obj format, change the path in the config file and run the code. |
| 108 | +Note that using this direction means that you will lose information on the |
| 109 | +hands. |
| 110 | + |
| 111 | + |
| 112 | +### SMPL to SMPL+H |
| 113 | + |
| 114 | +To run the code to convert SMPL meshes to SMPL+H parameters use the following command: |
| 115 | + ```Shell |
| 116 | + python main.py --exp-cfg config_files/smpl2smplh.yaml |
| 117 | + ``` |
| 118 | + |
| 119 | +The file *smpl2smplh.yaml* contains a sample configuration that reads meshes from a folder, |
| 120 | +processes them and returns pkl files with SMPL parameters. To run on your own data create a folder |
| 121 | +with SMPL meshes, in either ply or obj format, change the path in the config file and run the code. |
| 122 | + |
| 123 | +### SMPL+H to SMPL-X |
| 124 | + |
| 125 | +To run the code to convert SMPL+H meshes to SMPL-X parameters use the following command: |
| 126 | + ```Shell |
| 127 | + python main.py --exp-cfg config_files/smplh2smplx.yaml |
| 128 | + ``` |
| 129 | + |
| 130 | +The file *smplh2smplx.yaml* contains a sample configuration that reads meshes from a folder, |
| 131 | +processes them and returns pkl files with SMPL-X parameters. To run on your own data create a folder |
| 132 | +with SMPL+H meshes, in either ply or obj format, change the path in the config file and run the code. |
| 133 | + |
| 134 | + |
| 135 | +### SMPL-X to SMPL+H |
| 136 | + |
| 137 | +To run the code to convert SMPL-X meshes to SMPL+H parameters use the following command: |
| 138 | + ```Shell |
| 139 | + python main.py --exp-cfg config_files/smplx2smplh.yaml |
| 140 | + ``` |
| 141 | + |
| 142 | +The file *smplx2smpl.yaml* contains a sample configuration that reads meshes from a folder, |
| 143 | +processes them and returns pkl files with SMPL+H parameters. To run on your own data create a folder |
| 144 | +with SMPL-X meshes, in either ply or obj format, change the path in the config file and run the code. |
| 145 | +Make sure that you do not use the jaw pose and expression parameters to generate |
| 146 | +the meshes. |
| 147 | + |
| 148 | + |
| 149 | +## Visualize correspondences |
| 150 | + |
| 151 | +To visualize correspondences: |
| 152 | +```Shell |
| 153 | +python vis_correspondences.py --exp-cfg configs/smpl2smplx.yaml --exp-opts colors_path PATH_TO_SMPL_COLORS |
| 154 | +``` |
| 155 | +You should then see the following image. Points with similar color are in |
| 156 | +correspondence. |
| 157 | + |
| 158 | + |
| 159 | +## Citation |
| 160 | + |
| 161 | +Depending on which model is loaded for your project, i.e. SMPL-X or SMPL+H or SMPL, please cite the most relevant work: |
| 162 | + |
| 163 | +``` |
| 164 | +@article{SMPL:2015, |
| 165 | + author = {Loper, Matthew and Mahmood, Naureen and Romero, Javier and Pons-Moll, Gerard and Black, Michael J.}, |
| 166 | + title = {{SMPL}: A Skinned Multi-Person Linear Model}, |
| 167 | + journal = {ACM Transactions on Graphics, (Proc. SIGGRAPH Asia)}, |
| 168 | + month = oct, |
| 169 | + number = {6}, |
| 170 | + pages = {248:1--248:16}, |
| 171 | + publisher = {ACM}, |
| 172 | + volume = {34}, |
| 173 | + year = {2015} |
| 174 | +} |
| 175 | +``` |
| 176 | + |
| 177 | +``` |
| 178 | +@article{MANO:SIGGRAPHASIA:2017, |
| 179 | + title = {Embodied Hands: Modeling and Capturing Hands and Bodies Together}, |
| 180 | + author = {Romero, Javier and Tzionas, Dimitrios and Black, Michael J.}, |
| 181 | + journal = {ACM Transactions on Graphics, (Proc. SIGGRAPH Asia)}, |
| 182 | + volume = {36}, |
| 183 | + number = {6}, |
| 184 | + pages = {245:1--245:17}, |
| 185 | + series = {245:1--245:17}, |
| 186 | + publisher = {ACM}, |
| 187 | + month = nov, |
| 188 | + year = {2017}, |
| 189 | + url = {http://doi.acm.org/10.1145/3130800.3130883}, |
| 190 | + month_numeric = {11} |
| 191 | + } |
| 192 | +``` |
| 193 | + |
| 194 | + |
| 195 | +``` |
| 196 | +@inproceedings{SMPL-X:2019, |
| 197 | + title = {Expressive Body Capture: 3D Hands, Face, and Body from a Single Image}, |
| 198 | + author = {Pavlakos, Georgios and Choutas, Vasileios and Ghorbani, Nima and Bolkart, Timo and Osman, Ahmed A. A. and Tzionas, Dimitrios and Black, Michael J.}, |
| 199 | + booktitle = {Proceedings IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)}, |
| 200 | + year = {2019} |
| 201 | +} |
| 202 | +``` |
| 203 | + |
| 204 | + |
| 205 | +## Acknowledgments |
| 206 | +The code of this repository was implemented by [Vassilis Choutas ]([email protected]), |
| 207 | +based on a Chumpy implementation from [Timo Bolkart ]([email protected]). |
| 208 | + |
| 209 | +## Contact |
| 210 | + |
| 211 | +For questions, please contact [[email protected]]([email protected]). |
0 commit comments