Giter VIP home page Giter VIP logo

puwang40 / creatingandreenacting_wacv_2022 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from verlab/creatingandreenacting_wacv_2022

0.0 0.0 0.0 3.37 MB

PyTorch implementation of the human neural rendering in unseen positions presented at WACV 2022 "Creating and Reenacting Controllable 3D Humans with Differentiable Rendering"

License: GNU General Public License v3.0

Shell 1.48% Python 98.13% Dockerfile 0.39%

creatingandreenacting_wacv_2022's Introduction

Reenacting Controllable 3D Humans with Differentiable Rendering
[Project Page] [Paper] [Dataset]

       

This repository contains the PyTorch implementation of the neural rendering approach for reenacting humans "Creating and Reenacting Controllable 3D Humans with Differentiable Rendering" [paper].

The method leverages a carefully designed graph convolutional network (GCN) to model the human body manifold structure, jointly with differentiable rendering, to synthesize new videos of people in different contexts from where they were initially recorded.

Please cite our paper in your publications if it is helpful to your research:

@InProceedings{Gomes2022,
author = {Thiago L. Gomes and Thiago M. Coutinho and Rafael Azevedo and Renato Martins and Erickson R. Nascimento},
title={Creating and Reenacting Controllable 3D Humans with Differentiable Rendering},
booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
year = {2022}
}

I - Setup and Installation

Please check the detailed instructions using conda or Singularity in SETUP.md.

II - Human Retargeting Dataset

In order to train our networks so that they learn to transfer appearance and reenact humans, we use the Human Retargeting Dataset proposed in the paper: "A Shape-Aware Retargeting Approach to Transfer Human Motion and Appearance in Monocular Videos" repo. As the train set, we use the 4-min videos from actors S0, S2, S4, S6 and reenact on the entire test set of the other actors. In our code, we reorganized the Human Retargeting Dataset as follows:

train
└───S1P0 (actor S0 from retargeting dataset)
│   └─── frames
│   └─── segmentations
│   └─── poses
└───S2P0 (actor S2 from retargeting dataset)
│   └─── frames
│   └─── segmentations
│   └─── poses
|   ...
└───S4P0 (actor S6 from retargeting dataset)    
|       ...

Inside each actor folder, we create three subfolders:

  • frames: contains the frames extracted from the 4-min video provided in the Human Retargeting Dataset.
  • segmentations: contains the segmentations extracted using MODNet, saved with the same pattern name as in frames folder
  • poses: contains the SMPL parameters estimated using SPIN saved in pkl format with the same name pattern as the original images. The pickle files are structured as follows:
{
    'pose': array containing the SMPL pose parameters
        np.array<float>, shape (72,)
    'betas': array containing the SMPL betas parameters
        np.array<float>, shape (10,)
    'f': camera focal distance
        <float>
    'trans': array containing translation parameters
        np.array<float>, shape (3,)
   'img_shape': ndarray containing original image shape
        nd.array<float>, shape (W,H,3)
}

Example of original, segmentation and rendered SMPL images:

For the test set, we use a similar structure but without segmentations:

test
└───S1P0 (actor S0 from retargeting dataset)
│   └─── box
│       └─── frames
│       └─── poses
│   └─── rotate
│   └─── ...
│   └─── fusion dance
|   ...
└───S4P0 (actor S6 from retargeting dataset)    
|       ...

III - Usage

1. Activate the enviroment

singularity shell -B <bind-dir> --nv <image-name>
source activate env

2. Training

  • For train the mesh deformation in a sequence of the dataset, please run:
python trainMesh.py -s <subject> -p <person> -g <gender> -d <dataset_path>

  • Then to train texture stage, run:
python trainTexture.py -s <subject> -p <person> -g <gender> -d <dataset_path> -pm <mesh_network_path> --gan

3. Testing

  • For testing the model reenacting, please use:
python test.py -pm <mesh_network_path> -pt <texture_network_path> -pr <residual_texture_network_path> -s <subject> -p <person> -g <gender> -o <output_path>

VeRLab: Laboratory of Computer Vison and Robotics https://www.verlab.dcc.ufmg.br

creatingandreenacting_wacv_2022's People

Contributors

renatojmsdh avatar thiagoluange avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.