MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / blend_shapes

Function blend_shapes

util/smplx/smplx/lbs.py:262–282  ·  view source on GitHub ↗

Calculates the per vertex displacement due to the blend shapes. Parameters ---------- betas : torch.tensor Bx(num_betas) Blend shape coefficients shape_disps: torch.tensor Vx3x(num_betas) Blend shapes Returns ------- torch.tensor BxVx3 The per-ve

(betas: Tensor, shape_disps: Tensor)

Source from the content-addressed store, hash-verified

260
261
262def blend_shapes(betas: Tensor, shape_disps: Tensor) -> Tensor:
263 """Calculates the per vertex displacement due to the blend shapes.
264
265 Parameters
266 ----------
267 betas : torch.tensor Bx(num_betas)
268 Blend shape coefficients
269 shape_disps: torch.tensor Vx3x(num_betas)
270 Blend shapes
271
272 Returns
273 -------
274 torch.tensor BxVx3
275 The per-vertex displacement due to shape deformation
276 """
277
278 # Displacement[b, m, k] = sum_{l} betas[b, l] * shape_disps[m, k, l]
279 # i.e. Multiply each shape displacement by its corresponding beta and
280 # then sum them.
281 blend_shape = torch.einsum('bl,mkl->bmk', [betas, shape_disps])
282 return blend_shape
283
284
285def batch_rodrigues(

Callers 2

forwardMethod · 0.90
lbsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected