If you just want to project the joints and vertices using the SMPL/SMPL-X parameter file and Camera information then you need to run project_joints
. Following page will guide you through it.
Create and activate a Python 3.8
virtual environment:
python3.8 -m venv path_to_virtual_env
source path_to_virtual_env/bin/activate
First, checkout the code smplx:
$ git clone https://github.com/vchoutas/smplx.git
and install both packages with pip
:
$ pip install .
$ pip install ./smplx
Download the Images and extract them in demo/images
Download the Camera dataframe and extract in demo/Cam
Download the SMPL-X fits and extract it in demo/GT_fits
Download the SMPL-X model and place it in demo/model/smplx. Download the npz version and rename the models to SMPLX_MALE.npz, SMPLX_FEMALE.npz and SMPLX_NEUTRAL.npz
Download the kid template vertices from AGORA and place them in utils.
Download the SMPL fits model and extract it in demo/GT_fits
Download the SMPL model and place it in demo/model/smpl. Download the npz version and rename the models to SMPL_MALE.npz, SMPL_FEMALE.npz, SMPL_NEUTRAL.npz
Download the kid template vertices from AGORA and place them in utils.
Once you have finished installing and downloaded the data, you can run project_joints
executable. This will add following fields in all the .pkl files in the demo/Cam folder.
gt_joints_2d : projected 2d SMPL -X/SMPL keypoints/joints in image
gt_joints_3d : 3d SMPL-X/SMPL joints in camera coordinates
gt_verts : 3d SMPL-X/SMPL vertices in camera coordinates
project_joints --imgFolder demo/images --loadPrecomputed demo/Cam --modeltype SMPLX --kid_template_path utils/smplx_kid_template.npy --modelFolder demo/model --gt_model_path demo/GT_fits/ --imgWidth 3840 --imgHeight 2160
project_joints --imgFolder demo/images --loadPrecomputed demo/Cam --modeltype SMPL --kid_template_path utils/smpl_kid_template.npy --modelFolder demo/model --gt_model_path demo/GT_fits/ --imgWidth 3840 --imgHeight 2160
Just replace the --imgWidth and --imgHeight with 1280 and 720 in above commands.
If you need to debug the projection, use --debug boolean flag and provide --debug_path to store output images. This will generate images with projected ground truth 2d keypoints.