Calculates the 3D joint locations from the vertices. Parameters ---------- J_regressor : torch.tensor JxV The regressor array that is used to calculate the joints from the position of the vertices vertices : torch.tensor BxVx3 The tensor of mesh vertices
(J_regressor: Tensor, vertices: Tensor)
| 240 | |
| 241 | |
| 242 | def vertices2joints(J_regressor: Tensor, vertices: Tensor) -> Tensor: |
| 243 | """Calculates the 3D joint locations from the vertices. |
| 244 | |
| 245 | Parameters |
| 246 | ---------- |
| 247 | J_regressor : torch.tensor JxV |
| 248 | The regressor array that is used to calculate the joints from the |
| 249 | position of the vertices |
| 250 | vertices : torch.tensor BxVx3 |
| 251 | The tensor of mesh vertices |
| 252 | |
| 253 | Returns |
| 254 | ------- |
| 255 | torch.tensor BxJx3 |
| 256 | The location of the joints |
| 257 | """ |
| 258 | |
| 259 | return torch.einsum('bik,ji->bjk', [vertices, J_regressor]) |
| 260 | |
| 261 | |
| 262 | def blend_shapes(betas: Tensor, shape_disps: Tensor) -> Tensor: |