Expressive Body Capture: 3D Hands, Face, and Body from a Single Image

Overview

Expressive Body Capture: 3D Hands, Face, and Body from a Single Image

[Project Page] [Paper] [Supp. Mat.]

SMPL-X Examples

Table of Contents

License

Software Copyright License for non-commercial scientific research purposes. Please read carefully the terms and conditions and any accompanying documentation before you download and/or use the SMPL-X/SMPLify-X model, data and software, (the "Model & Software"), including 3D meshes, blend weights, blend shapes, textures, software, scripts, and animations. By downloading and/or using the Model & Software (including downloading, cloning, installing, and any other use of this github repository), you acknowledge that you have read these terms and conditions, understand them, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Model & Software. Any infringement of the terms of this agreement will automatically terminate your rights under this License.

Disclaimer

The original images used for the figures 1 and 2 of the paper can be found in this link. The images in the paper are used under license from gettyimages.com. We have acquired the right to use them in the publication, but redistribution is not allowed. Please follow the instructions on the given link to acquire right of usage. Our results are obtained on the 483 × 724 pixels resolution of the original images.

Description

This repository contains the fitting code used for the experiments in Expressive Body Capture: 3D Hands, Face, and Body from a Single Image.

Fitting

Run the following command to execute the code:

python smplifyx/main.py --config cfg_files/fit_smplx.yaml 
    --data_folder DATA_FOLDER 
    --output_folder OUTPUT_FOLDER 
    --visualize="True/False"
    --model_folder MODEL_FOLDER
    --vposer_ckpt VPOSER_FOLDER
    --part_segm_fn smplx_parts_segm.pkl

where the DATA_FOLDER should contain two subfolders, images, where the images are located, and keypoints, where the OpenPose output should be stored.

Different Body Models

To fit SMPL or SMPL+H, replace the yaml configuration file with either fit_smpl.yaml or fit_smplx.yaml, i.e.:

  • for SMPL:
python smplifyx/main.py --config cfg_files/fit_smpl.yaml 
   --data_folder DATA_FOLDER 
   --output_folder OUTPUT_FOLDER 
   --visualize="True/False"
   --model_folder MODEL_FOLDER
   --vposer_ckpt VPOSER_FOLDER
  • for SMPL+H:
python smplifyx/main.py --config cfg_files/fit_smplh.yaml 
   --data_folder DATA_FOLDER 
   --output_folder OUTPUT_FOLDER 
   --visualize="True/False"
   --model_folder MODEL_FOLDER
   --vposer_ckpt VPOSER_FOLDER

Visualizing Results

To visualize the results produced by the method you can run the following script:

python smplifyx/render_results.py --mesh_fns OUTPUT_MESH_FOLDER

where OUTPUT_MESH_FOLDER is the folder that contains the resulting meshes.

Dependencies

Follow the installation instructions for each of the following before using the fitting code.

  1. PyTorch
  2. SMPL-X
  3. VPoser
  4. Homogenus

Optional Dependencies

  1. PyTorch Mesh self-intersection for interpenetration penalty
  2. Trimesh for loading triangular meshes
  3. Pyrender for visualization

The code has been tested with Python 3.6, CUDA 10.0, CuDNN 7.3 and PyTorch 1.0 on Ubuntu 18.04.

Citation

If you find this Model & Software useful in your research we would kindly ask you to cite:

@inproceedings{SMPL-X:2019,
  title = {Expressive Body Capture: 3D Hands, Face, and Body from a Single Image},
  author = {Pavlakos, Georgios and Choutas, Vasileios and Ghorbani, Nima and Bolkart, Timo and Osman, Ahmed A. A. and Tzionas, Dimitrios and Black, Michael J.},
  booktitle = {Proceedings IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)},
  year = {2019}
}

Acknowledgments

LBFGS with Strong Wolfe Line Search

The LBFGS optimizer with Strong Wolfe Line search is taken from this Pytorch pull request. Special thanks to Du Phan for implementing this. We will update the repository once the pull request is merged.

Contact

The code of this repository was implemented by Vassilis Choutas and Georgios Pavlakos.

For questions, please contact [email protected].

For commercial licensing (and all related questions for business applications), please contact [email protected].

Comments
  • How to extract the 3D joint location

    How to extract the 3D joint location

    Hello,

    Very impressive works! I am wondering how can I extract the 3D joint coordinates from the code? (and also the name of the corresponding joint)

    I am trying this model_output = body_model(return_verts=True, body_pose=body_pose) joints = model_output.joints.detach().cpu().numpy().squeeze() and it returns a (118,3) arrays. How can I locate 3D joints coordinates from this (e.g., left-elbow, left-wrist....)

    Thanks!!!

    opened by zhou595 29
  • FileNotFoundError: [Errno 2] No such file or directory:

    FileNotFoundError: [Errno 2] No such file or directory:

    Hi, I have this problem that I can not solve the file keypoints was created with OpenPose and is present in the directory, I do not understand the reason for this error?

    SMPLIFY-X) bash-3.2$ python smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder DATA_FOLDER --output_folder OUTPUT_FOLDER --visualize="True" --model_folder models --vposer_ckpt models/vposer_v1_0
    Traceback (most recent call last):
      File "smplifyx/main.py", line 272, in <module>
        main(**args)
      File "smplifyx/main.py", line 201, in main
        for idx, data in enumerate(dataset_obj):
      File "/Users/piero/Desktop/SMPLIFY-X/smplify-x/smplifyx/data_parser.py", line 206, in __next__
        return self.next()
      File "/Users/piero/Desktop/SMPLIFY-X/smplify-x/smplifyx/data_parser.py", line 215, in next
        return self.read_item(img_path)
      File "/Users/piero/Desktop/SMPLIFY-X/smplify-x/smplifyx/data_parser.py", line 185, in read_item
        use_face_contour=self.use_face_contour)
      File "/Users/piero/Desktop/SMPLIFY-X/smplify-x/smplifyx/data_parser.py", line 54, in read_keypoints
        with open(keypoint_fn) as keypoint_file:
    FileNotFoundError: [Errno 2] No such file or directory: 'DATA_FOLDER/keypoints/COCO_val2014_000000000459_rendered_keypoints.json'
    
    
    opened by Piero-M 27
  • Code is Stuck

    Code is Stuck

    I am using python3.6 , torch 1.1.0 and when i am running the smplifyx/main.py , as python3 smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder input/ --output_folder output/ --visualize="True" --model_folder ../models/ --vposer_ckpt ../vposer/ --part_segm_fn ../smplx_parts_segm.pkl

    i am getting error, pyglet.gl.ContextException: Could not create GL context

    and the code is getting stuck like this. Screenshot from 2019-08-07 16-18-13

    Any help?

    opened by punjal97 13
  • Some questions about “body_pose”

    Some questions about “body_pose”

    Hello! Thanks for the great work! I want to know why number of parameters of "body_pose" is 32 ? and how to change "32" to "63" ? Can I get 63 parameters of "body_pose" directly from the smplifyx program? And in the following code left_hand_pose = torch.einsum( 'bi,ij->bj', [left_hand_pose, self.left_hand_components]) left_hand_pose.shape : (1, 12) self.left_hand_components : (45, 45) Does left_hand_pose need to go through some processing? Thank you!

    opened by moondabaojian 12
  • ImportError: cannot import name 'load_vposer' from 'human_body_prior.tools.model_loader'

    ImportError: cannot import name 'load_vposer' from 'human_body_prior.tools.model_loader'

    Hi,

    In the file fit_single_frame.py the code wants to import load_vposer from human_body_prior.tools.model_loader

    However, there does not seem to be a load_vposer() function in human_body_prior/tools/model_loader.py. What am I missing here?

    opened by Saafke 11
  • FileNotFoundError: [Errno 2] No such file or directory: 'DATA_FOLDER/keypoints

    FileNotFoundError: [Errno 2] No such file or directory: 'DATA_FOLDER/keypoints

    Good morning, this model seems to me extremely exciting!

    I have configuration problems, in fact I have this error and I do not understand, keypoints should be generated by myself or should I do something?

    This is the error:

    python smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder DATA_FOLDER --output_folder OUTPUT_FOLDER --visualize="True" --model_folder MODEL_FOLDER --vposer_ckpt VPOSER_FOLDER --part_segm_fn smplx_parts_segm.pkl Traceback (most recent call last): File "smplifyx/main.py", line 272, in main(args) File "smplifyx/main.py", line 201, in main for idx, data in enumerate(dataset_obj): File "/Users/piero******/anaconda3/envs/AVATAR/smplify-x/smplifyx/data_parser.py", line 206, in next return self.next() File "/Users/piero********/anaconda3/envs/AVATAR/smplify-x/smplifyx/data_parser.py", line 215, in next return self.read_item(img_path) File "/Users/piero********/anaconda3/envs/AVATAR/smplify-x/smplifyx/data_parser.py", line 185, in read_item use_face_contour=self.use_face_contour) File "/Users/piero********/anaconda3/envs/AVATAR/smplify-x/smplifyx/data_parser.py", line 54, in read_keypoints with open(keypoint_fn) as keypoint_file: FileNotFoundError: [Errno 2] No such file or directory: 'DATA_FOLDER/keypoints/76_img_keypoints.json'

    opened by Piero-M 11
  • Fitting is bad when some joints are not visible

    Fitting is bad when some joints are not visible

    Hi, @vchoutas! First of all, thank you for such nice work and clear code!

    I want to fit SMPL-X model to images, where some joints are not visible, e.g. upper-body photos or even face photos. I tried several images and found out that the method works much worse when some joints are out of the frame (you can see examples below). The resulting fits don't much the input at all.

    I believe this issue can be somehow fixed by nullifying some joints' weights during optimization or by some other optimization tweak. What do you think is the best way to do it?

    Input | SMPLify-X :-------------------------:|:-------------------------: 2020-03-05 18 30 18 | 2020-03-05 18 30 25 2020-03-05 18 30 34 | 2020-03-05 18 30 29 2020-03-05 18 30 48 | 2020-03-05 18 30 43

    opened by karfly 10
  • IndexError: list index out of range

    IndexError: list index out of range

    Hi, I just wanted to note this is amazing work! I've been trying to test Smplify-X on a custom image of a person standing up.

    I've been getting this error: Traceback (most recent call last): File "smplifyx/render_results.py", line 99, in <module> mesh_fn = key_handler.get_mesh_fn() File "smplifyx/render_results.py", line 54, in get_mesh_fn return self.mesh_fns[self.idx] IndexError: list index out of range

    Any idea how to fix this? Thanks!

    opened by octas 10
  • Segmentation fault

    Segmentation fault

    Testing sample images found in smplify-x/src/homogenous-master/samples. Every time there is a segmentation fault at beginning of Stage 3:

    ~/smplify-x$ python3 smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder data --output_folder output --visualize="True" --model_folder ../smpl-x/models --vposer_ckpt ../smpl-x/vposer_v1_0

    Processing: data/images/im1097.jpg Found Trained Model: ../smpl-x/vposer_v1_0/snapshots/TR00_E096.pt Camera initialization done after 7.6183 Camera initialization final loss 1101.1987 Stage 000 done after 28.3231 seconds
    Stage 001 done after 5.3000 seconds
    Stage 002 done after 13.7803 seconds
    Orientation: 0%| | 0/1 [00:47<?, ?it/s Segmentation fault (core dumped)███▊ | 3/5 [00:47<00:38, 19.13s/it]

    opened by zorropop 8
  • Segment Fault at stage002

    Segment Fault at stage002

    Hi I got an error at stage002 as following: image

    I debugged and found the error is at

     final_loss_val = monitor.run_fitting(
                        body_optimizer,
                        closure, final_params,
                        body_model,
                        pose_embedding=pose_embedding, vposer=vposer,
                        use_vposer=use_vposer)
    

    Does anyone have any ideas what is wrong? Thx.

    opened by SecretGuardian 8
  • Obj view is different from the image

    Obj view is different from the image

    Hi,

    I was able to run the smplify-x.

    step 01 below is my image. tummy_man

    step 02 I generate the keypoints from openpose and generate the json file as follows.(plz remove the .pdf and add .json ) tummy_man_keypoints.pdf

    tummy_man_rendered

    step 03 Then i provide the step 01 image and the step 02 tummy_man_keypoints.json to the smplify-x.

    i run the smplifyx,

    python3 smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder DATA_FOLDER --output_folder OUTPUT_FOLDER --visualize="False" --model_folder MODEL_FOLDER --vposer_ckpt VPOSER_FOLDER

    inside DATA_FOLDER contain two subfolders, images, where the images are located, and keypoints, where the OpenPose output should be stored.

    inside MODEL_FOLDER put the SMPL-X Model

    inside VPOSER_FOLDER put the VPoser: Variational Human Pose Prior

    OUTPUT OF THE CONSOLE

    Processing: /home/xxxx/simplifyx/smplify-x/DATA_FOLDER/images/tummy_man.png /home/xxxx/simplifyx/smplify-x/OUTPUT_FOLDER/meshes/tummy_man /home/xxxx/simplifyx/smplify-x/OUTPUT_FOLDER/results/tummy_man Found Trained Model: /home/xxxx/simplifyx/smplify-x/VPOSER_FOLDER/snapshots/TR00_E096.pt Camera initialization done after 2.4678 Camera initialization final loss 4296.7549 Stage 000 done after 5.3883 seconds
    Stage 001 done after 3.4187 seconds
    Stage 002 done after 11.2370 seconds
    Stage 003 done after 9.5738 seconds
    Stage 004 done after 8.8275 seconds
    Body fitting Orientation 0 done after 38.4547 seconds
    Body final loss val = 9400.93066
    Orientation: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:38<00:00, 38.46s/it] Processing the data took: 00 hours, 00 minutes, 46 seconds

    Then obj file was generated.The screenshot of the view is as follows.

    tummy_man_obj_view

    Seems to be the output is wrong. Can any one help me to get the correct output?

    opened by tharinduk90 8
  • ValueError: Unknown model type models, exiting!

    ValueError: Unknown model type models, exiting!

    Hi there, I've been having some issues with getting smplify-x to run and would appreciate any advice on the matter. The only other thread I've come across suggested installing and unpacking smplx in the right folders for neutral, male and female models, which I've done under smplify-x/data/models.

    When I attempt to run: (tf) elizabeth@mili:~/smplify-x$ python smplifyx/main.py --config cfg_files/fit_smpl.yaml

    Traceback (most recent call last): File "/home/elizabeth/smplify-x/smplifyx/main.py", line 272, in main(**args) File "/home/elizabeth/smplify-x/smplifyx/main.py", line 117, in main male_model = smplx.create(gender='male', **model_params) File "/home/elizabeth/miniconda3/envs/tf/lib/python3.9/site-packages/smplx/body_models.py", line 2410, in create raise ValueError(f'Unknown model type {model_type}, exiting!') ValueError: Unknown model type models, exiting!

    Another error I've gotten is when I try the command: (tf) elizabeth@mili:~/smplify-x$ python smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder DATA_FOLDER --output_folder OUTPUT_FOLDER --model_folder MODEL_FOLDER --vposer_ckpt VPOSER_FOLDER --part_segm_fn smplx_parts_segm.pkl

    Traceback (most recent call last): File "/home/elizabeth/smplify-x/smplifyx/main.py", line 272, in main(**args) File "/home/elizabeth/smplify-x/smplifyx/main.py", line 84, in main dataset_obj = create_dataset(img_folder=img_folder, **args) File "/home/elizabeth/smplify-x/smplifyx/data_parser.py", line 47, in create_dataset return OpenPose(data_folder, **kwargs) File "/home/elizabeth/smplify-x/smplifyx/data_parser.py", line 136, in init for img_fn in os.listdir(self.img_folder) FileNotFoundError: [Errno 2] No such file or directory: 'DATA_FOLDER/images'

    Thank you for your time & I'd greatly appreciate any help I could receive on this matter!

    opened by elizabethjcobs 0
  • estimating camera and shape only once for the whole sequence?

    estimating camera and shape only once for the whole sequence?

    In the way we are running SMPLify, it reestimates shape and camera position with every frame. In our datasets, we know that it was the same person (same shape) and that the camera position was fixed. Could we estimate the shape and the camera from the whole session (e.g., 5-min. video), then fix it and run through the video again and estimate only the poses?

    opened by matejhof 2
  • fit to a scan

    fit to a scan

    Hi, thank you for the amazing work. How can we fit the smplify-x on 3d scan data? There is a script for fitting FLAME to scan. Can we use this to fit smplify-x on 3d scan? FLAME fit to scan

    opened by Monibsediqi 0
  • The generated mesh is anomalous

    The generated mesh is anomalous

    When I run the result generated by the EHF dataset, except the first generated mesh is a normal human body shape, the other generated meshes are all alien shapes, why? imageHas anyone encountered this problem? image

    opened by lllllialois 0
  • Adding texture using MPI Mesh

    Adding texture using MPI Mesh

    I took the smplx_texture_m_alb.png texture image file (see image below) from the SMPLX Blender Add-On. I wanted to add texture to the SMPLX mesh using this image outside of Blender. smplx_texture_m_alb_1024

    Following the documentation of MPI Mesh, I used the following command: Mesh.set_texture_image('smplx_texture_m_alb.png'). However, I am facing an issue with the eye positioning in the output (see figure below): textured

    What is causing this issue? Note that the texture is getting loaded correctly when imported in Blender add-on. (see figure below) image

    opened by hshreeshail 1
Owner
Vassilis Choutas
Ph.D. Student, Perceiving Systems, Max Planck ETH Center for Learning Systems
Vassilis Choutas
SMPL-X: A new joint 3D model of the human body, face and hands together

SMPL-X: A new joint 3D model of the human body, face and hands together [Paper Page] [Paper] [Supp. Mat.] Table of Contents License Description News I

Vassilis Choutas 1k Jan 9, 2023
ERISHA is a mulitilingual multispeaker expressive speech synthesis framework. It can transfer the expressivity to the speaker's voice for which no expressive speech corpus is available.

ERISHA: Multilingual Multispeaker Expressive Text-to-Speech Library ERISHA is a multilingual multispeaker expressive speech synthesis framework. It ca

Ajinkya Kulkarni 43 Nov 27, 2022
Face and Pose detector that emits MQTT events when a face or human body is detected and not detected.

Face Detect MQTT Face or Pose detector that emits MQTT events when a face or human body is detected and not detected. I built this as an alternative t

Jacob Morris 38 Oct 21, 2022
MediaPipeのPythonパッケージのサンプルです。2020/12/11時点でPython実装のある4機能(Hands、Pose、Face Mesh、Holistic)について用意しています。

mediapipe-python-sample MediaPipeのPythonパッケージのサンプルです。 2020/12/11時点でPython実装のある以下4機能について用意しています。 Hands Pose Face Mesh Holistic Requirement mediapipe 0.

KazuhitoTakahashi 217 Dec 12, 2022
Full body anonymization - Realistic Full-Body Anonymization with Surface-Guided GANs

Realistic Full-Body Anonymization with Surface-Guided GANs This is the official

Håkon Hukkelås 30 Nov 18, 2022
WormMovementSimulation - 3D Simulation of Worm Body Movement with Neurons attached to its body

Generate 3D Locomotion Data This module is intended to create 2D video trajector

null 1 Aug 9, 2022
A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run.

Minimal Hand A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run. This project provides the

Yuxiao Zhou 824 Jan 7, 2023
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019). A PyTorch implementation.

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set —— PyTorch implementation This is an unofficial offici

Sicheng Xu 833 Dec 28, 2022
STYLER: Style Factor Modeling with Rapidity and Robustness via Speech Decomposition for Expressive and Controllable Neural Text to Speech

STYLER: Style Factor Modeling with Rapidity and Robustness via Speech Decomposition for Expressive and Controllable Neural Text to Speech Keon Lee, Ky

Keon Lee 114 Dec 12, 2022
FrankMocap: A Strong and Easy-to-use Single View 3D Hand+Body Pose Estimator

FrankMocap pursues an easy-to-use single view 3D motion capture system developed by Facebook AI Research (FAIR). FrankMocap provides state-of-the-art 3D pose estimation outputs for body, hand, and body+hands in a single system. The core objective of FrankMocap is to democratize the 3D human pose estimation technology, enabling anyone (researchers, engineers, developers, artists, and others) can easily obtain 3D motion capture outputs from videos and images.

Facebook Research 1.9k Jan 7, 2023
Expressive Power of Invariant and Equivaraint Graph Neural Networks (ICLR 2021)

Expressive Power of Invariant and Equivaraint Graph Neural Networks In this repository, we show how to use powerful GNN (2-FGNN) to solve a graph alig

Marc Lelarge 36 Dec 12, 2022
Implementation of "GNNAutoScale: Scalable and Expressive Graph Neural Networks via Historical Embeddings" in PyTorch

PyGAS: Auto-Scaling GNNs in PyG PyGAS is the practical realization of our G NN A uto S cale (GAS) framework, which scales arbitrary message-passing GN

Matthias Fey 139 Dec 25, 2022
Axel - 3D printed robotic hands and they controll with Raspberry Pi and Arduino combo

Axel It's our graduation project about 3D printed robotic hands and they control

null 0 Feb 14, 2022
Code for "Neural Parts: Learning Expressive 3D Shape Abstractions with Invertible Neural Networks", CVPR 2021

Neural Parts: Learning Expressive 3D Shape Abstractions with Invertible Neural Networks This repository contains the code that accompanies our CVPR 20

Despoina Paschalidou 161 Dec 20, 2022
PyTorch Implementation of Daft-Exprt: Robust Prosody Transfer Across Speakers for Expressive Speech Synthesis

Daft-Exprt - PyTorch Implementation PyTorch Implementation of Daft-Exprt: Robust Prosody Transfer Across Speakers for Expressive Speech Synthesis The

Keon Lee 47 Dec 18, 2022
Checkout some cool self-projects you can try your hands on to curb your boredom this December!

SoC-Winter Checkout some cool self-projects you can try your hands on to curb your boredom this December! These are short projects that you can do you

Web and Coding Club, IIT Bombay 29 Nov 8, 2022
GazeScroller - Using Facial Movements to perform Hands-free Gesture on the system

GazeScroller Using Facial Movements to perform Hands-free Gesture on the system

null 2 Jan 5, 2022
Face Library is an open source package for accurate and real-time face detection and recognition

Face Library Face Library is an open source package for accurate and real-time face detection and recognition. The package is built over OpenCV and us

null 52 Nov 9, 2022