Coder Social home page Coder Social logo

pomisbest / danet-3dhumanreconstruction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hongwenzhang/danet-densepose2smpl

0.0 0.0 0.0 751 KB

[TPAMI20] Learning 3D Human Shape and Pose from Dense Body Parts

Home Page: https://hongwenzhang.github.io/dense2mesh

Python 99.96% Shell 0.04%

danet-3dhumanreconstruction's Introduction

Learning 3D Human Shape and Pose from Dense Body Parts

This repository includes the PyTorch code of the network described in Learning 3D Human Shape and Pose from Dense Body Parts.

Project Page

Requirements

  • Python 3.6.10

packages

necessary files

DensePose UV data

  • Run the following script to fetch DensePose UV data.
bash get_densepose_uv.sh

SMPL model files

Fetch preprocessed data from SPIN and here.

Download the pre-trained models and put them into the ./data/pretrained_model directory.

After collecting the above necessary files, the directory structure of ./data is expected as follows.

./data
├── dataset_extras
│   └── .npz files
├── J_regressor_extra.npy
├── J_regressor_h36m.npy
├── pretrained_model
│   ├── .pt files
│   └── learned_ratio.pkl
├── smpl
│   ├── SMPL_FEMALE.pkl
│   ├── SMPL_MALE.pkl
│   └── SMPL_NEUTRAL.pkl
├── smpl_mean_params.npz
├── static_fits
│   └── .npy files
└── UV_data
    ├── UV_Processed.mat
    └── UV_symmetry_transforms.mat

Rendering IUV

The IUV_Renderer can be used to generate ground-truth IUV maps when given a batch of SMPL vertices and cameras. An example of usage can be found here.

Demo

  1. Run the demo code. Using --use_opendr if the opendr package is successfully installed.
python3 demo.py --checkpoint=data/pretrained_model/danet_model_h36m_itw.pt --img_dir ./examples --use_opendr
  1. View visualization results in ./output. Results are organized (from left to right) as the input image, the estimated IUV maps (global and partial), the rendered IUV of the predicted SMPL model, the predicted SMPL model (front and side views).

Evaluation

Human3.6M / 3DPW

Run the evaluation code. Using --dataset to specify the evaluation dataset.

# Example usage:

# Human3.6M Protocol 2
python3 eval.py --checkpoint=data/pretrained_model/danet_model_h36m_itw.pt --dataset=h36m-p2 --log_freq=20

# 3DPW
python3 eval.py --checkpoint=data/pretrained_model/danet_model_h36m_itw.pt --dataset=3dpw --log_freq=20

COCO Keypoint Localization

  1. Download the preprocessed data coco_2014_val.npz. Put it into the ./data/dataset_extras directory.

  2. Run the COCO evaluation code.

python3 eval_coco.py --checkpoint=data/pretrained_model/danet_model_h36m_dpcoco.pt

Training

To perform training, we need to collect pretraining models and preprocessed files of training datasets at first.

The pretraining models can be downloaded from HRNet. The preprocessed labels have the same format as SPIN and can be retrieved from here. Please refer to SPIN for more details about data preprocessing. As for DensePose-COCO, we provide the preprocessed data here.

The training of DaNet consists of two stages. We will train the IUV estimator alone at the first stage for around 5k iterations, then we involve other modules in training for the rest of 60k iterations at the second stage. Example usage:

python3 train.py --name danet --batch_size 16 --vis_interval 1000 --pretr_step 5000

Running the above command will use Human3.6M and DensePose-COCO for training by default. We can monitor the training process by setting up a TensorBoard at the directory ./logs.

Citation

If this work is helpful in your research, please cite the following paper.

@article{zhang2020learning,
  title={Learning 3D Human Shape and Pose from Dense Body Parts},
  author={Zhang, Hongwen and Cao, Jie and Lu, Guo and Ouyang, Wanli and Sun, Zhenan},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year={2020}
}

Acknowledgments

The code is developed upon the following projects. Many thanks to their contributions.

danet-3dhumanreconstruction's People

Contributors

hongwenzhang avatar tinatiansjz 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.