Healthcare-Robotics / BodyPressure

Inferring Body Pose and Contact Pressure from a Depth Image
Other
28 stars 4 forks source link

BodyPressure - v1.0

Inferring Body Pose and Contact Pressure from a Depth Image

None

Paper:

Clever, Henry M., Patrick Grady, Greg Turk, and Charles C. Kemp. "BodyPressure: Inferring Body Pose and Contact Pressure from a Depth Image." ArXiv preprint: https://arxiv.org/pdf/2105.09936.pdf Accepted for publication at IEEE Transactions on Pattern Analysis and Machine Intelligence, 12/27/2021

Code version (v1.0) note:

This is the "initial submission" version of the code.

What code is in here?

This repository:

Getting started

Setup code:

Clone this repository to get started with inspecting the DepthPress data and training the deep network variants.\ git clone https://github.com/Healthcare-Robotics/BodyPressure.git\ cd BodyPressure\ pip install -r requirements.txt apt install texlive-latex-extra apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super

If it's missing any requirements please create an issue and I will fix it.

Change FILEPATH.txt to reference the location of this folder on your computer.

Download SMPL human model, you must create a free account here https://smpl.is.tue.mpg.de/en. Copy smpl directory to BodyPressure/smpl.

This repository uses Python 3.6, with the exception of the BodyPressureSD synthetic data generation code (which is 2.7).

Download data:

Simultaneously-collected multimodal Lying Pose dataset: Follow the instructions on the site below.

Cleaned up and calibrated real data addendum: SLP depth images with in-fill for where hair causes noise and where viewframe drops off side of the bed, spatial transforms from the camera to the bed, and ground truth reconstructed pressure maps P+. This is 484 MB.

SLP-3Dfits data: 4,545 SMPL bodies fit to 101 participants in the SLP dataset using mesh vertex to point cloud point optimization. This is 18 MB.

BodyPressureSD synthetic dataset: 97,495 SMPL body shapes + poses with synthetic depth images and pressure images. This is 8.5 GB.

Trained models: the best performing networks presented in the paper.

BodyPressureSD addendum: 3D environment meshes for human, blanket, deformed mattress, and deformed pressure sensing mat.

Your file structure should look like this:

BodyPressure
├── data_BP
│   ├── convnets
│   │   ├── CAL_10665ct_128b_500e_0.0001lr.pt
│   │   ├── betanet_108160ct_128b_volfrac_500e_0.0001lr.pt
│   │   ├── resnet34_1_anglesDC_108160ct_128b_x1pm_rgangs_lb_slpb_dpns_rt_100e_0.0001lr.pt
│   │   └── resnet34_2_anglesDC_108160ct_128b_x1pm_0.5rtojtdpth_depthestin_angleadj_rgangs_lb_lv2v_slpb_dpns_rt_40e_0.0001lr.pt
│   │
│   ├── mod1est_real
│   ├── mod1est_synth
│   ├── results
│   ├── SLP
│   │   └── danaLab
│   │       ├── 00001
│   │       .
│   │       └── 00102
│   │   
│   ├── slp_real_cleaned
│   │   ├── depth_uncover_cleaned_0to102.npy
│   │   ├── depth_cover1_cleaned_0to102.npy
│   │   ├── depth_cover2_cleaned_0to102.npy
│   │   ├── depth_onlyhuman_0to102.npy
│   │   ├── O_T_slp_0to102.npy
│   │   ├── slp_T_cam_0to102.npy
│   │   ├── pressure_recon_Pplus_gt_0to102.npy
│   │   └── pressure_recon_C_Pplus_gt_0to102.npy
│   │   
│   ├── SLP_SMPL_fits
│   │   └── fits
│   │       ├── p001
│   │       .
│   │       └── p102
│   │   
│   ├── synth
│   │   ├── train_slp_lay_f_1to40_8549.p
│   │   .
│   │   └── train_slp_rside_m_71to80_1939.p
│   │   
│   ├── synth_depth
│   │   ├── train_slp_lay_f_1to40_8549_depthims.p
│   │   .
│   │   └── train_slp_rside_m_71to80_1939_depthims.p
│   │   
│   └── synth_meshes
│
├── docs
.
.
└── smpl
    ├── models
    ├── smpl_webuser
    └── smpl_webuser3

SLP-3Dfits dataset visualization

To visualize a particular subject in the SLP-3Dfits dataset with pressure projection in 3D, run the following:

This will do a 3D rendering of subject 77, pose number 13, with an uncovered point cloud. You can choose any subject from 1 to 102 or any pose from 1 to 45. All poses below are ground truth SLP-3Dfits (not deep model inferences). It shows them separately to better inspect correspondence with the pressure mat and point cloud. The green also has 3D joints on the SMPL model visualized.

None None None

To visualize a particular subject in the SLP-3Dfits dataset in a 2D rendering, run the following:

None

Both pressure mats are ground truth.

BodyPressureSD dataset visualization

To visualize a particular subject in the BodyPressureSD dataset with pressure projection in 3D, run the following:

This will do a 3D rendering of filenum 2, which corresponds to train_slp_lside_f_1to40_8136.p, on pose number 492. You can choose any file from 1 to 18 or any pose from 1 to 10000ish, however many poses are in the file. All poses below are ground truth BodyPressureSD data samples (not deep model inferences). It shows them separately to better inspect correspondence with the pressure mat. The green also has 3D joints on the SMPL model visualized.

None None None

To visualize a particular subject in the SLP-3Dfits dataset in a 2D rendering, run the following:

None

Pressure mat is ground truth.

Training BodyPressure deep networks

There are 4 steps to train BodyPressureWnet or BodyPressureBnet as implemented in the paper.

None

None

Testing BodyPressure deep networks on real SLP data

To test, you can visualize its output in different ways.

None None None None

None

None

Code for generating BodyPressureSD

None