SMPL-X Body Model
raw JSON → 0.1.28 verified Fri May 01 auth: no python
PyTorch module for loading the SMPL-X body model, a unified model of body, face, and hands. Current version 0.1.28, with sporadic releases.
pip install smplx Common errors
error FileNotFoundError: [Errno 2] No such file or directory: 'models/SMPLX_NEUTRAL.npz' ↓
cause Model files not present in the specified path or wrong model_path.
fix
Download model files from https://smpl-x.is.tue.mpg.de/ and place them in the correct directory.
error ModuleNotFoundError: No module named 'smplx.smplx' ↓
cause Using deprecated import path after update.
fix
Use 'from smplx import SMPLX' instead of 'from smplx.smplx import SMPLX'.
error TypeError: __init__() got an unexpected keyword argument 'model_folder' ↓
cause Old argument 'model_folder' not recognized in current version.
fix
Use 'model_path' instead of 'model_folder'.
Warnings
deprecated Importing from 'smplx.smplx' or 'smplx.smpl' is deprecated. Use top-level 'from smplx import SMPLX'. ↓
fix Change import to 'from smplx import SMPLX'.
gotcha The model expects paths to the model files (e.g., 'SMPLX_NEUTRAL.npz') not just directory. Missing files cause cryptic errors. ↓
fix Ensure the directory contains the correct .npz model files (download from SMPL-X website).
breaking Model path argument changed from 'model_folder' to 'model_path' in v0.1.20. Old code will break. ↓
fix Use model_path='/path/to/models/' instead of model_folder.
Imports
- SMPL wrong
from smplx.smpl import SMPLcorrectfrom smplx import SMPL - SMPLX wrong
from smplx.smplx import SMPLXcorrectfrom smplx import SMPLX - SMPLH
from smplx import SMPLH
Quickstart
import torch
from smplx import SMPLX
model = SMPLX(model_path='models/', gender='neutral')
body_pose = torch.zeros(1, 63)
betas = torch.zeros(1, 10)
output = model(body_pose=body_pose, betas=betas)
print(output.vertices.shape)