Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/MEPP-team/SpecTrHuMS
28 July 2023, 12:42:45 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • b43255d
  • /
  • README.md
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:376371afed051b3bf797ef7fbe5f9f8aba9779dc
origin badgedirectory badge
swh:1:dir:b43255df7715850ec72f2789a9389a8cae27a1fa
origin badgerevision badge
swh:1:rev:683831be6abc326522c36c34160f76a4bc36a9dd
origin badgesnapshot badge
swh:1:snp:069422c94dfa9246adb4c160c92aa47bc3ebd1bc

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 683831be6abc326522c36c34160f76a4bc36a9dd authored by Clément Lemeunier on 26 July 2023, 06:49:28 UTC
README.md
Tip revision: 683831b
README.md
# SpecTrHuMS: Spectral Transformer for Human Mesh Sequence learning

This repository contains the PyTorch implementation of the paper **SpecTrHuMS: Spectral Transformer for Human Mesh Sequence learning** by *Clément Lemeunier, Florence Denis, Guillaume Lavoué and Florent Dupont*.

<p align="center">
<img src="images/graphical_abstract.jpg" alt="graphical_abstract" width="500"/>
</p>

## Setup

The code was tested on Linux with PyTorch 2.0.1, CUDA 11.7 and Python 3.10.

Create a conda environment and activate it:
```
conda create -n SpecTrHuMS python=3.10
conda activate SpecTrHuMS
```

Install [PyTorch](https://pytorch.org/get-started/locally/).

Install [Human Body Prior](https://github.com/nghorbani/human_body_prior): clone the repository, and execute commands in the `Installation` chapter while the conda environment is activated (launch both commands even if there are errors).

Install requirements:
```
pip install -r requirements.txt
```

## SMPL connectivity and its eigenvectors + pretrained model

Download [this archive](https://drive.google.com/file/d/1blzKhIiMS630qI8t1YaaNYdWZhYt1Rmb/view?usp=sharing) and extract it to the root folder. It contains the SMPL connectivity with its eigenvectors computed with [Matlab](https://fr.mathworks.com/products/matlab.html) and a pretrained model corresponding to the SpecTrHuMS-MI (see paper). This should create two folders: `data` and `checkpoints`.

## SMPL models

Go the [MANO](https://mano.is.tue.mpg.de/index.html) `Download` webpage and download the `Extended SMPL+H model`. Create a folder `smplh` in the `data` folder previously created, and extract the archive in the `smplh` folder. Then, go the [SMPL](https://smpl.is.tue.mpg.de/index.html) `Download` webpage and download `DMPLs compatible with SMPL`, create a folder `dmpls` in the `data` folder, and extract the archive in the `dmpls` folder. This should give the following hierarchy:

```
data
 ┣ dmpls
 ┃ ┣ female
 ┃ ┃ ┗ model.npz
 ┃ ┣ male
 ┃ ┃ ┗ model.npz
 ┃ ┣ neutral
 ┃ ┃ ┗ model.npz
 ┣ smplh
 ┃ ┣ female
 ┃ ┃ ┗ model.npz
 ┃ ┣ male
 ┃ ┃ ┗ model.npz
 ┃ ┣ neutral
 ┃ ┃ ┗ model.npz
 ┣ evecs_4096.bin
 ┗ faces.bin
```

## Create the dataset

First, download the following [AMASS](https://amass.is.tue.mpg.de/download.php) datasets: 

1. CMU 
1. MPI_Limits 
1. TotalCapture 
1. Eyes_Japan_Dataset 
1. KIT 
1. EKUT 
1. TCD_handMocap 
1. ACCAD 
1. BioMotionLab_NTroje

and modify the variable `amass_directory` in the file `dataset_creation/default_options_dataset.json` to the path where you downloaded AMASS datasets.

Then, launch the following script: 

```python create_dataset.py```

This will create a dataset made of multiple identities. The size of the created dataset is approximately 20Gb. You can use less frequencies in order to have a smaller dataset by modifying the value in the file `dataset_creation/default_options_dataset.json`, but the dataset will not be usable by the given pretrained model and you will have to retrain a new one.

## Evaluate / visualize a pretrained model

A pretrained model is available in the `checkpoints/SpecTrHuMS-MI/` directory and corresponds to the *Spectral Transformer for Human Mesh Sequence learning using Multiple Identities*.

It is possible to: 
- evaluate the model's scores on the test dataset: `python test.py --load_job_id=SpecTrHuMS-MI`. After computation, scroll up a bit in the console to view results: this allows to reproduce results in Table 3 line `SpecTrHuMS-MI`. 
- visualize its ability to predict the end of animations: `python visualize.py --load_job_id=SpecTrHuMS-MI` using [aitviewer
](https://github.com/eth-ait/aitviewer). 

## Train a new model

In order to train a model, execute the following command by specifying a `job_id`: 
<br />
```python train.py --job_id=0 ``` <br />
or <br />
```python train.py --job_id=SpecTrHuMS-test``` 

Training is done using the framework [PyTorch Lightning](https://www.pytorchlightning.ai/index.html). It will create a new folder in the `checkpoints/` directory and create logs in the corresponding folder, which you can visualize using the command `tensorboard --logdir checkpoints/`. 

## Video

An additional video file is provided (in the `video` folder) in order to better visualise results.

<p align="center">
<video width="600" controls>
  <source src="video/SpecTrHuMS.mp4" type="video/mp4">
</video>
</p>

## Acknowledgements
This work was supported by the ANR project Human4D ANR-19-CE23-0020 and was granted access to the AI resources of IDRIS under the allocation 2023-AD011012424R2 made by GENCI.

## License
This work is Copyright of University of Lyon, 2023. It is distributed under the Mozilla Public License v. 2.0. (refer to the accompanying file LICENSE-MPL2.txt or a copy at http://mozilla.org/MPL/2.0/).

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API