Home

Awesome

Dataset: "Decaf: Monocular Deformation Capture for Face and Hand Interactions" SIGGRAPH Aisa '23.

Authors: Soshi Shimada, Vladislav Golyanik, Patrick Pérez, Christian Theobalt

<p align="center"> <img src="./images/defdata2-min.gif" alt="Alt text for the GIF"> </p>

This is the official repository of Decaf dataset:

Download

The main dataset can be downloaded from here.
If you want the preprocessed images (i.e., background masking + cropping using a bounding box), download the data from here.

Dataset Visualization Script Setup

Clone the repo:

git clone https://github.com/soshishimada/DecafDatasetScript
cd DecafDatasetScript

Requirements

  1. To install the dependencies other than PyTorch and Pytorch3d, you can run:

    pip install -r requirements.txt&&pip install git+'https://github.com/otaheri/MANO'
    

        Or use conda environment:

    bash install_conda.sh
    
  2. For installing the same versions of torch and pytorch3D as the ones we used, you can run the commands below. Please see their official page for more details. First, make sure again the virtual environment in which the packages are installed in the last step is activated ("decaf_env" is the conda environment in this example):

    conda activate decaf_env
    

    Then run:

    pip install torch==1.12.1 --index-url https://download.pytorch.org/whl/cu113&&git clone https://github.com/facebookresearch/pytorch3d.git&&cd ./pytorch3d&&git checkout tags/v0.7.2&&pip install -e .&&cd ..
    

Example scripts

  1. After downloading the dataset (DecafDataset), place the head and hand model under "DecafDataset/assets":

    • Download "FLAME 2020" from here. Extract and place "generic_model.pkl" under assets folder.
    • Download the mano hand model "mano_v1_2" from here. Place it under assets folder.
    • Get "landmark_embedding.npy" from here. Place it under assets folder.

    Now the folder should look like this:

    DecafDataset/
    ├── assets/
    │   ├── left_right_face_corresps.pkl
    │   ├── generic_model.pkl
    │   ├── landmark_embedding.npy
    │   ├── mano_v1_2
    │   ├── FLAME_neck_idx.npy
    │   ├── accurate_shapes
    │   ├── aug_back_ground
    │   ├── transformation
    │   ├── default_mesh.ply
    │   └── neck_idx.npy
    ├── test
    └── train
    
  2. For the online visualization of the dataset, run the following command. Note that the path to the DecafDataset needs to be specified by --dataset_path option. E.g., Provide "--dataset_path ../DecafDataset" if your DecafDataset folder is located under the same folder as "DecafDatasetScript" folder.:

    python src/visualizer.py --dataset_path /PATH/TO/DATASET --vis_con 0 --vis3d 1 --vis2d 1 --show_every 5
    

    The example below shows the image sequence with keypoints overlay. Green keypoints are from 2D keypont detectors and blue keypoints are projected points of the 3D face and hand.

    • --vis_con: visualization of contacts on a face and a hand.
    • --show_every: visualize the data every n frames.
    • --vis3d: visualization in 3D
    • --vis2d: visualization in 2D
<p align="center"> <img src="./images/visualization.gif" width="80%" /> </p> <br>
  1. Example of how to flip deformations, contacts and images for data augmentation:

    python src/flipping_data.py --dataset_path /PATH/TO/DATASET --save_path ./results/flip/ --vis_3d 1
    

    The original and flipped data will be saved under the path specified by --save_path option.

<p align="center"> <img src="./images/ori3d.png" width="45%" /> <img src="./images/flipped3d.png" width="45%" /> </p> <p align="center"> <em>Original 3D mesh with deformation + contacts.&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;Flipped 3D mesh with deformation + contacts.</em> </p> <p align="center"> <img src="./images/img.png" width="45%" /> <img src="./images/img_f.png" width="45%" /> </p> <p align="center"> <em>Original 3D mesh with deformation + contacts.&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;Flipped 3D mesh with deformation + contacts.</em> </p> <p align="center"> <img src="./images/flip_deform_con.png" width="60%" /> </p> <p align="center"> <em>Turn on --vis_3d option for the interactive 3D visualization.</em> </p>
  1. Example of how to apply masking on an image:

    python src/get_masked_image.py --dataset_path /PATH/TO/DATASET --save_path ./results/mask/
    
<p align="center"> <img src="./images/rgb_image.jpg" width="45%" /> <img src="./images/masked_image.jpg" width="45%" /> </p> <p align="center"> <em>Original image&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;Masked image</em> </p> <br>
  1. Example of how to obtain consecutive data ids:
    python src/get_consecutive_ids.py --dataset_path /PATH/TO/DATASET  
    

License Terms

Permission is hereby granted, free of charge, to any person or company obtaining a copy of this dataset and associated documentation files (the "Dataset") from the copyright holders to use the Dataset for any non-commercial purpose. Redistribution and (re)selling of the Dataset, of modifications, extensions, and derivates of it, and of other dataset containing portions of the licensed Dataset, are not permitted. The Copyright holder is permitted to publically disclose and advertise the use of the software by any licensee.

Packaging or distributing parts or whole of the provided software (including code and data) as is or as part of other datasets is prohibited. Commercial use of parts or whole of the provided dataset (including code and data) is strictly prohibited.

THE DATASET IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATASET OR THE USE OR OTHER DEALINGS IN THE DATASET.

Citation

If the dataset is used, the licensee is required to cite the following publication in any documentation or publication that results from the work:

@article{
      DecafTOG2023,
      author = {Shimada, Soshi and Golyanik, Vladislav and P\'{e}rez, Patrick and Theobalt, Christian},
      title = {Decaf: Monocular Deformation Capture for Face and Hand Interactions},
      journal = {ACM Transactions on Graphics (TOG)}, 
      month = {dec},
      volume = {42},
      number = {6}, 
      articleno = {264},
      year = {2023}, 
      publisher = {ACM} 
    }