experimenting.models package¶
Submodules¶
experimenting.models.losses module¶
Losses implementations
-
class
experimenting.models.losses.
HeatmapLoss
(reduction='mask_mean', n_joints=13)¶
-
class
experimenting.models.losses.
PixelWiseLoss
(reduction='mask_mean', divergence=True)¶
-
class
experimenting.models.losses.
MultiPixelWiseLoss
(reduction='mask_mean', divergence=True)¶
experimenting.models.margipose module¶
Implementation of Margipose Model. Thanks to A. Nibali — original source code: https://github.com/anibali/margipose/src/margipose
-
class
experimenting.models.margipose.
MargiPoseModel2D
(n_stages, backbone_path, n_joints, n_channels=1)¶ -
class
HeatmapCombiner
(n_joints, n_planes, out_channels)¶
-
forward
(inputs)¶ Model forward process :param inputs: input batch
- Returns
Triple of list of heatmaps of length {n_stages}
-
class
-
class
experimenting.models.margipose.
MargiPoseModel3D
(n_stages, in_cnn, in_shape, n_joints, permute_axis=False)¶ Multi-stage marginal heatmap estimator
-
class
HeatmapCombiner
(n_joints, n_planes, out_channels)¶
-
forward
(inputs) → Tuple[List[Any], List[Any], List[Any]]¶ Model forward process :param inputs: input batch
- Returns
Triple of list of heatmaps of length {n_stages}
-
class
-
class
experimenting.models.margipose.
MargiPoseStage
(n_joints, mid_shape, heatmap_space, permute)¶
experimenting.models.metrics module¶
Metrics implementation for 3D human pose comparisons
-
class
experimenting.models.metrics.
MPJPE
(reduction=None, confidence=0, **kwargs)¶ -
forward
(y_pr, points_gt, gt_mask=None)¶ Base forward method for metric evaluation :param y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3) :param points_gt: 3D gt of joints, tensor of shape (BATCH_SIZExN_JOINTSx3) :param gt_mask: boolean mask, tensor of shape (BATCH_SIZExN_JOINTS). :param Applied to results, if provided:
- Returns
Metric as single value, if reduction is given, or as a tensor of values
-
-
class
experimenting.models.metrics.
AUC
(reduction=None, auc_reduction=torch.mean, start_at=0, end_at=500, step=30, **kwargs)¶ Area Under the Curve for PCK metric, at different thresholds (from 0 to 800)
-
forward
(y_pr, points_gt, gt_mask=None)¶ Base forward method for metric evaluation :param y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3) :param points_gt: 3D gt of joints, tensor of shape (BATCH_SIZExN_JOINTSx3) :param gt_mask: boolean mask, tensor of shape (BATCH_SIZExN_JOINTS). :param Applied to results, if provided:
- Returns
Metric as single value, if reduction is given, or as a tensor of values
-
-
class
experimenting.models.metrics.
PCK
(reduction=None, threshold=150, **kwargs)¶ Percentage of correct keypoints according to a thresold value. Usually default threshold is 150mm
-
forward
(y_pr, points_gt, gt_mask=None)¶ Base forward method for metric evaluation :param y_pr: 3D prediction of joints, tensor of shape (BATCH_SIZExN_JOINTSx3) :param points_gt: 3D gt of joints, tensor of shape (BATCH_SIZExN_JOINTSx3) :param gt_mask: boolean mask, tensor of shape (BATCH_SIZExN_JOINTS). :param Applied to results, if provided:
- Returns
Metric as single value, if reduction is given, or as a tensor of values
-