Code repository for the paper: Hierarchical Kinematic Probability Distributions for 3D Human Shape and Pose Estimation from Images in the Wild (ICCV 2021)

Overview

Hierarchical Kinematic Probability Distributions for 3D Human Shape and Pose Estimation from Images in the Wild

Akash Sengupta, Ignas Budvytis, Roberto Cipolla
ICCV 2021
[paper+supplementary][poster][results video]

This is the official code repository of the above paper, which takes a probabilistic approach to 3D human shape and pose estimation and predicts multiple plausible 3D reconstruction samples given an input image.

teaser

This repository contains inference, training (TODO) and evaluation (TODO) code. A few weaknesses of this approach, and future research directions, are listed below (TODO). If you find this code useful in your research, please cite the following publication:

@InProceedings{sengupta2021hierprobhuman,
               author = {Sengupta, Akash and Budvytis, Ignas and Cipolla, Roberto},
               title = {{Hierarchical Kinematic Probability Distributions for 3D Human Shape and Pose Estimation from Images in the Wild}},
               booktitle = {International Conference on Computer Vision},
               month = {October},
               year = {2021}                         
}

Installation

Requirements

  • Linux or macOS
  • Python ≥ 3.6

Instructions

We recommend using a virtual environment to install relevant dependencies:

python3 -m venv HierProbHuman
source HierProbHuman/bin/activate

Install torch and torchvision (the code has been tested with v1.6.0 of torch), as well as other dependencies:

pip install torch==1.6.0 torchvision==0.7.0
pip install -r requirements.txt

Finally, install pytorch3d, which we use for data generation during training and visualisation during inference. To do so, you will need to first install the CUB library following the instructions here. Then you may install pytorch3d - note that the code has been tested with v0.3.0 of pytorch3d, and we recommend installing this version using:

pip install "git+https://github.com/facebookresearch/[email protected]"

Model files

You will need to download the SMPL model. The neutral model is required for training and running the demo code. If you want to evaluate the model on datasets with gendered SMPL labels (such as 3DPW and SSP-3D), the male and female models are available here. You will need to convert the SMPL model files to be compatible with python3 by removing any chumpy objects. To do so, please follow the instructions here.

Download pre-trained model checkpoints for our 3D Shape/Pose network, as well as for 2D Pose HRNet-W48 from here.

Place the SMPL model files and network checkpoints in the model_files directory, which should have the following structure. If the files are placed elsewhere, you will need to update configs/paths.py accordingly.

HierarchicalProbabilistic3DHuman
├── model_files                                  # Folder with model files
│   ├── smpl
│   │   ├── SMPL_NEUTRAL.pkl                     # Gender-neutral SMPL model
│   │   ├── SMPL_MALE.pkl                        # Male SMPL model
│   │   ├── SMPL_FEMALE.pkl                      # Female SMPL model
│   ├── poseMF_shapeGaussian_net_weights.tar     # Pose/Shape distribution predictor checkpoint
│   ├── pose_hrnet_w48_384x288.pth               # Pose2D HRNet checkpoint
│   ├── cocoplus_regressor.npy                   # Cocoplus joints regressor
│   ├── J_regressor_h36m.npy                     # Human3.6M joints regressor
│   ├── J_regressor_extra.npy                    # Extra joints regressor
│   └── UV_Processed.mat                         # DensePose UV coordinates for SMPL mesh             
└── ...

Inference

run_predict.py is used to run inference on a given folder of input images. For example, to run inference on the demo folder, do:

python run_predict.py --image_dir ./demo/ --save_dir ./output/ --visualise_samples --visualise_uncropped

This will first detect human bounding boxes in the input images using Mask-RCNN. If your input images are already cropped and centred around the subject of interest, you may skip this step using --cropped_images as an option. The 3D Shape/Pose network is somewhat sensitive to cropping and centering - this is a good place to start troubleshooting in case of poor results.

Inference can be slow due to the rejection sampling procedure used to estimate per-vertex 3D uncertainty. If you are not interested in per-vertex uncertainty, you may modify predict/predict_poseMF_shapeGaussian_net.py by commenting out code related to sampling, and use a plain texture to render meshes for visualisation (this will be cleaned up and added as an option to in the run_predict.py future).

TODO

  • Training Code
  • Evaluation Code for 3DPW and SSP-3D
  • Gendered pre-trained models for improved shape estimation
  • Weaknesses and future research

Acknowledgments

Code was adapted from/influenced by the following repos - thanks to the authors!

Comments
  • not getting 3d shape

    not getting 3d shape

    Hello, I am running prediction script with no errors but I only get hrnet pose heatmap. The other images do not have SMPL model overlaid. Am I missing something?

    Thank you.

    opened by asluborski 6
  • Training time

    Training time

    Hi,

    Thank you for the amazing work!

    I was wondering how long does the synthetic data training take, considering there is no DataParallel/DistributedDataParallel implementation. Thank you in advance!

    opened by rohitrango 5
  • Why learn scale?

    Why learn scale?

    Dear Akash,

    I read your paper, as well as other papers from the series ([2], [3], [4]). :) It's interesting that your attempts are one of the few trying to recover an accurate shape of the person, instead of mostly focusing on a 3D pose.

    However, the crucial question that is still bothering me is why do you use unnormalized loss components, such verts3d and joints3d? I guess you already thought about that and decided to still force the model to learn the scale. The advantage that I see using this approach is the regularization effect, where you confuse the model and then hope that it will still manage to somehow figure out the scale, i.e., height of the person.

    Thanks in advance!

    opened by kristijanbartol 3
  • project SMPL vertices to 3d space with respective camera matrix

    project SMPL vertices to 3d space with respective camera matrix

    Hi,

    i would like to use your code for my research work but I encounter some problems and require some support.

    My ultimate goal is to get the 3d coordinates of the vertices with my own camera matrix K. I want later on make selective body region selection and and need the 3d coordinates of the Human body to do so.

    Acoording to your code, the SMPL vertices in the proxy representation and i would like to get the 3d coordinates somehow out of it.

    Could you tell me how to do the projection from the proxy to the 3d coordinates using a specific camera matrix.

    I would appreciate your help.

    thanks

    opened by friendly-code-bot 2
  • run_predict.py generates output with same image

    run_predict.py generates output with same image

    Hello first of all - nice Job.

    I am doing right now a research project regarding self collision and i would like to use your repo as a baseline to generate 3d avatars of people.

    I ran your run_predict.py successfully but noticed that the output image contains multiple smaller, identical images. I was expecting something similar as the teaser.png where u have the estimated 3d mesh of the person.

    Could you please tell me how to reproduce this visualization? I would like to get the 3d mesh and use it as a mask to overlap with a pointcloud..

    I would appreciate your help

    Thanks

    opened by chillcloud-dev 2
  • render problem

    render problem

    Hello,

    When I run the Inference Step, I got: Traceback (most recent call last): File "run_predict.py", line 126, in gender=args.gender) File "run_predict.py", line 90, in run_predict visualise_samples=visualise_samples) File "/Users/mac/Desktop/reconstruction/predict/predict_poseMF_shapeGaussian_net.py", line 197, in predict_poseMF_shapeGaussian_net verts_features=vertex_var_colours) File "/opt/anaconda3/envs/ll/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/Users/mac/Desktop/reconstruction/renderers/pytorch3d_textured_renderer.py", line 275, in forward fragments = self.rasterizer(meshes_iuv, cameras=self.cameras) File "/opt/anaconda3/envs/ll/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/opt/anaconda3/envs/ll/lib/python3.6/site-packages/pytorch3d/renderer/mesh/rasterizer.py", line 151, in forward cull_backfaces=raster_settings.cull_backfaces, File "/opt/anaconda3/envs/ll/lib/python3.6/site-packages/pytorch3d/renderer/mesh/rasterize_meshes.py", line 150, in rasterize_meshes cull_backfaces, File "/opt/anaconda3/envs/ll/lib/python3.6/site-packages/pytorch3d/renderer/mesh/rasterize_meshes.py", line 205, in forward cull_backfaces, RuntimeError: NOT IMPLEMENTED "

    Do you have any idea on it?

    opened by Austin13579 2
  • About the distribution of relative rotation

    About the distribution of relative rotation

    Hi... Thanks for the great job! And I have a question: In part <3.4. Body shape and pose distribution prediction>,

    Here, each joint is modelled independently of all the other joints. Thus, the matrix parameter of the i-th joint, F_i , is a function of the input X only.

    As you mentioned in the paper that the probability density function of each joint’s relative rotation matrix is a matrix-Fisher distribution conditioned on the parents of that joint in the kinematic tree. So I am confused that why you can model each joint independently as "each joint is modelled independently of all the other joints" ....

    opened by qihangran 2
  • Downloading time of the background file

    Downloading time of the background file

    Dear akash,

    Thank you very much for the amazing work! When I tried to download the background files, it said I would probably need two weeks due to the slow downloading speed in google colab (I tried several different high-speed internets). Can I ask how you download them, or do you have a downloaded version already in your google drive that you can share?

    Thanks again! :)

    opened by 0scarJ1ang 1
  • Projecting predicted vertices given predicted camera

    Projecting predicted vertices given predicted camera

    Hi,

    I'm interested in projecting the predicted vertices given the predicted camera. There is a a functionality in STRAPS for this:

                    pred_vertices2d = orthographic_project_torch(pred_vertices, pred_cam_wp)
                    pred_vertices2d = undo_keypoint_normalisation(pred_vertices2d,
                                                                  proxy_rep_input_wh)
    

    Is there something similar in HierarchicalProbabilistic3DHuman? I would like to avoid using body_vis_renderer.

    Thanks!

    opened by itzsid 1
  • error shape when get part render

    error shape when get part render

    when i want to training straps,i find a problem,i put the vertices and cam_t in renderer,can not get the true shape ,the shape is not (B,N,W,H),just a image(3,256,256),your code wirte that parts, _, mask = self.renderer(vertices, self.faces, self.textures, t=cam_ts),but i can not get three value,just one value which shape is 3,256,256

    opened by zhangzhenyu-zzy 0
Owner
Akash Sengupta
Akash Sengupta
Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Ibai Gorordo 99 Dec 31, 2022
Code for ICCV 2021 paper "HuMoR: 3D Human Motion Model for Robust Pose Estimation"

Code for ICCV 2021 paper "HuMoR: 3D Human Motion Model for Robust Pose Estimation"

Davis Rempe 367 Dec 24, 2022
Towards Multi-Camera 3D Human Pose Estimation in Wild Environment

PanopticStudio Toolbox This repository has a toolbox to download, process, and visualize the Panoptic Studio (Panoptic) data. Note: Sep-21-2020: Curre

null 335 Jan 9, 2023
Code for "Human Pose Regression with Residual Log-likelihood Estimation", ICCV 2021 Oral

Human Pose Regression with Residual Log-likelihood Estimation [Paper] [arXiv] [Project Page] Human Pose Regression with Residual Log-likelihood Estima

JeffLi 347 Dec 24, 2022
Human POSEitioning System (HPS): 3D Human Pose Estimation and Self-localization in Large Scenes from Body-Mounted Sensors, CVPR 2021

Human POSEitioning System (HPS): 3D Human Pose Estimation and Self-localization in Large Scenes from Body-Mounted Sensors Human POSEitioning System (H

Aymen Mir 66 Dec 21, 2022
HPRNet: Hierarchical Point Regression for Whole-Body Human Pose Estimation

HPRNet: Hierarchical Point Regression for Whole-Body Human Pose Estimation Official PyTroch implementation of HPRNet. HPRNet: Hierarchical Point Regre

Nermin Samet 53 Dec 4, 2022
Universal Probability Distributions with Optimal Transport and Convex Optimization

Sylvester normalizing flows for variational inference Pytorch implementation of Sylvester normalizing flows, based on our paper: Sylvester normalizing

Rianne van den Berg 172 Dec 13, 2022
[ICCV-2021] An Empirical Study of the Collapsing Problem in Semi-Supervised 2D Human Pose Estimation

An Empirical Study of the Collapsing Problem in Semi-Supervised 2D Human Pose Estimation (ICCV 2021) Introduction This is an official pytorch implemen

rongchangxie 42 Jan 4, 2023
Official Pytorch implementation of "Beyond Static Features for Temporally Consistent 3D Human Pose and Shape from a Video", CVPR 2021

TCMR: Beyond Static Features for Temporally Consistent 3D Human Pose and Shape from a Video Qualtitative result Paper teaser video Introduction This r

Hongsuk Choi 215 Jan 6, 2023
This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation

SO-Pose This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation This paper is basically an

shangbuhuan 52 Nov 25, 2022
This repository is the offical Pytorch implementation of ContextPose: Context Modeling in 3D Human Pose Estimation: A Unified Perspective (CVPR 2021).

Context Modeling in 3D Human Pose Estimation: A Unified Perspective (CVPR 2021) Introduction This repository is the offical Pytorch implementation of

null 37 Nov 21, 2022
Code for "3D Human Pose and Shape Regression with Pyramidal Mesh Alignment Feedback Loop"

PyMAF This repository contains the code for the following paper: 3D Human Pose and Shape Regression with Pyramidal Mesh Alignment Feedback Loop Hongwe

Hongwen Zhang 450 Dec 28, 2022
This is an official implementation of our CVPR 2021 paper "Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression" (https://arxiv.org/abs/2104.02300)

Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression Introduction In this paper, we are interested in the bottom-up paradigm of estima

HRNet 367 Dec 27, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

selfcontact This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] It includes the main function

Lea Müller 68 Dec 6, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

SMPLify-XMC This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] License Software Copyright Lic

Lea Müller 83 Dec 14, 2022
CVPR 2021 - Official code repository for the paper: On Self-Contact and Human Pose.

TUCH This repo is part of our project: On Self-Contact and Human Pose. [Project Page] [Paper] [MPI Project Page] License Software Copyright License fo

Lea Müller 45 Jan 7, 2023
Pytorch implementation for A-NeRF: Articulated Neural Radiance Fields for Learning Human Shape, Appearance, and Pose

A-NeRF: Articulated Neural Radiance Fields for Learning Human Shape, Appearance, and Pose Paper | Website | Data A-NeRF: Articulated Neural Radiance F

Shih-Yang Su 172 Dec 22, 2022
Code for ICCV 2021 paper: ARAPReg: An As-Rigid-As Possible Regularization Loss for Learning Deformable Shape Generators..

ARAPReg Code for ICCV 2021 paper: ARAPReg: An As-Rigid-As Possible Regularization Loss for Learning Deformable Shape Generators.. Installation The cod

Bo Sun 132 Nov 28, 2022
The project is an official implementation of our paper "3D Human Pose Estimation with Spatial and Temporal Transformers".

3D Human Pose Estimation with Spatial and Temporal Transformers This repo is the official implementation for 3D Human Pose Estimation with Spatial and

Ce Zheng 363 Dec 28, 2022