Evaluate fitted parameters through loss computation. This function serves two purposes: 1) internally, for loss backpropagation 2) externally, for fitting quality evaluation. Notes: B: batch size K: number of keypoints D: shape dimension
(
self,
betas: torch.Tensor = None,
body_pose: torch.Tensor = None,
global_orient: torch.Tensor = None,
transl: torch.Tensor = None,
keypoints2d: torch.Tensor = None,
keypoints2d_conf: torch.Tensor = None,
keypoints2d_weight: float = None,
keypoints3d: torch.Tensor = None,
keypoints3d_conf: torch.Tensor = None,
keypoints3d_weight: float = None,
shape_prior_weight: float = None,
joint_prior_weight: float = None,
smooth_loss_weight: float = None,
pose_prior_weight: float = None,
pose_reg_weight: float = None,
limb_length_weight: float = None,
joint_weights: dict = {},
return_verts: bool = False,
return_full_pose: bool = False,
return_joints: bool = False,
reduction_override: str = None,
)
| 385 | pre_loss = loss.item() |
| 386 | |
| 387 | def evaluate( |
| 388 | self, |
| 389 | betas: torch.Tensor = None, |
| 390 | body_pose: torch.Tensor = None, |
| 391 | global_orient: torch.Tensor = None, |
| 392 | transl: torch.Tensor = None, |
| 393 | keypoints2d: torch.Tensor = None, |
| 394 | keypoints2d_conf: torch.Tensor = None, |
| 395 | keypoints2d_weight: float = None, |
| 396 | keypoints3d: torch.Tensor = None, |
| 397 | keypoints3d_conf: torch.Tensor = None, |
| 398 | keypoints3d_weight: float = None, |
| 399 | shape_prior_weight: float = None, |
| 400 | joint_prior_weight: float = None, |
| 401 | smooth_loss_weight: float = None, |
| 402 | pose_prior_weight: float = None, |
| 403 | pose_reg_weight: float = None, |
| 404 | limb_length_weight: float = None, |
| 405 | joint_weights: dict = {}, |
| 406 | return_verts: bool = False, |
| 407 | return_full_pose: bool = False, |
| 408 | return_joints: bool = False, |
| 409 | reduction_override: str = None, |
| 410 | ) -> dict: |
| 411 | """Evaluate fitted parameters through loss computation. This function |
| 412 | serves two purposes: 1) internally, for loss backpropagation 2) |
| 413 | externally, for fitting quality evaluation. |
| 414 | |
| 415 | Notes: |
| 416 | B: batch size |
| 417 | K: number of keypoints |
| 418 | D: shape dimension |
| 419 | |
| 420 | Args: |
| 421 | betas: shape (B, D) |
| 422 | body_pose: shape (B, 69) |
| 423 | global_orient: shape (B, 3) |
| 424 | transl: shape (B, 3) |
| 425 | keypoints2d: 2D keypoints of shape (B, K, 2) |
| 426 | keypoints2d_conf: 2D keypoint confidence of shape (B, K) |
| 427 | keypoints2d_weight: weight of 2D keypoint loss |
| 428 | keypoints3d: 3D keypoints of shape (B, K, 3). |
| 429 | keypoints3d_conf: 3D keypoint confidence of shape (B, K) |
| 430 | keypoints3d_weight: weight of 3D keypoint loss |
| 431 | shape_prior_weight: weight of shape prior loss |
| 432 | joint_prior_weight: weight of joint prior loss |
| 433 | smooth_loss_weight: weight of smooth loss |
| 434 | pose_prior_weight: weight of pose prior loss |
| 435 | pose_reg_weight: weight of pose regularization loss |
| 436 | limb_length_weight: weight of limb length loss |
| 437 | joint_weights: per joint weight of shape (K, ) |
| 438 | return_verts: whether to return vertices |
| 439 | return_joints: whether to return joints |
| 440 | return_full_pose: whether to return full pose |
| 441 | reduction_override: reduction method, e.g., 'none', 'sum', 'mean' |
| 442 | |
| 443 | Returns: |
| 444 | ret: a dictionary that includes body model parameters, |
no test coverage detected