MHR¶
MHR is an expressive full-body model with neural pose correctives.
Setup¶
MHR downloads from the public abcamiletto/body-models Hugging Face repository on first use. The hosted package keeps the original MHR checkpoint for the default LOD 1 path and adds preprocessed FBX-derived mesh assets for LODs 0 through 6.
To prefetch and save the path:
# Download the MHR assets and store their path in the body-models config.
body-models download mhr
The original MHR license is included with the hosted assets.
API¶
body_models.bodies.mhr.numpy.MHR
¶
MHR(model_path=None, *, lod=1, simplify=1.0)
Bases: SkinnedModel
MHR body model with NumPy backend.
Initialize the MHR model.
| PARAMETER | DESCRIPTION |
|---|---|
model_path
|
Path to model assets, or the default assets when omitted.
TYPE:
|
lod
|
Level-of-detail variant to load.
TYPE:
|
simplify
|
Mesh simplification factor to apply while loading.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
forward_vertices |
Compute posed mesh vertices. |
forward_skeleton |
Compute posed joint transforms. |
prepare_identity |
Precompute shape- and expression-dependent state for repeated forward passes. |
prepare_pose |
Precompute pose-dependent state for repeated forward passes. |
joint_index |
Resolve a standard joint to this model's native joint index. |
prepare_skinning |
Pack prepared model state into renderer-ready skinning inputs. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
common_joints |
Common anatomical joints mapped to this model's native joint names.
TYPE:
|
Source code in src/body_models/bodies/mhr/numpy.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
common_joints
property
¶
common_joints
Common anatomical joints mapped to this model's native joint names.
forward_vertices
¶
forward_vertices(
body_pose,
head_pose,
hand_pose,
expression,
global_rotation=None,
global_translation=None,
vertex_indices=None,
*,
shape=None,
identity=None,
)
Compute posed mesh vertices.
| PARAMETER | DESCRIPTION |
|---|---|
shape
|
Shape coefficients.
TYPE:
|
body_pose
|
Local body joint rotations.
TYPE:
|
head_pose
|
Local head and facial controls.
TYPE:
|
hand_pose
|
Local hand joint rotations.
TYPE:
|
expression
|
Facial expression coefficients.
TYPE:
|
global_rotation
|
Global model rotation.
TYPE:
|
global_translation
|
Global model translation.
TYPE:
|
vertex_indices
|
Optional subset of vertices to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Float[ndarray, '*batch V 3']
|
Posed vertex positions. |
Source code in src/body_models/bodies/mhr/numpy.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
forward_skeleton
¶
forward_skeleton(
body_pose,
head_pose,
hand_pose,
expression,
global_rotation=None,
global_translation=None,
joint_indices=None,
*,
shape=None,
identity=None,
)
Compute posed joint transforms.
| PARAMETER | DESCRIPTION |
|---|---|
shape
|
Shape coefficients.
TYPE:
|
body_pose
|
Local body joint rotations.
TYPE:
|
head_pose
|
Local head and facial controls.
TYPE:
|
hand_pose
|
Local hand joint rotations.
TYPE:
|
expression
|
Facial expression coefficients.
TYPE:
|
global_rotation
|
Global model rotation.
TYPE:
|
global_translation
|
Global model translation.
TYPE:
|
joint_indices
|
Optional subset of joints to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Float[ndarray, '*batch J 4 4']
|
Joint transforms in the model hierarchy. |
Source code in src/body_models/bodies/mhr/numpy.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
prepare_identity
¶
prepare_identity(shape, expression, skip_vertices=False)
Precompute shape- and expression-dependent state for repeated forward passes.
Source code in src/body_models/bodies/mhr/numpy.py
189 190 191 192 193 194 195 196 | |
prepare_pose
¶
prepare_pose(
body_pose,
head_pose,
hand_pose,
*,
identity=None,
skip_vertices=False,
)
Precompute pose-dependent state for repeated forward passes.
Source code in src/body_models/bodies/mhr/numpy.py
198 199 200 201 202 203 204 205 206 207 208 209 | |
joint_index
¶
joint_index(joint)
Resolve a standard joint to this model's native joint index.
Source code in src/body_models/base.py
63 64 65 66 67 68 69 70 71 | |
prepare_skinning
¶
prepare_skinning(*, identity, pose)
Pack prepared model state into renderer-ready skinning inputs.
Source code in src/body_models/base.py
136 137 138 139 140 141 142 143 144 145 146 | |