Different loss functions for the Temporal Model.

Mean per-joint position error

Also known as the Euclidean distance:Let $p$ be the predicted vector and $q$ be the ground truth for each joint, where $p,q \in \mathbb{R}^3$ then$$ MPJPE(p,q) = \sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2 + (p_3 - q_3)^2}$$

mpjpe[source]

mpjpe(predicted, target)

Mean per-joint position error (i.e mean Euclidean distance), often referred to as "Protocol #1" in many papers.

def mpjpe(predicted, target):
    """
    Mean per-joint position error (i.e mean Euclidean distance),
    often referred to as "Protocol #1" in many papers.
    """
    
    assert predicted.shape == target.shape
    return torch.mean(torch.norm(predicted - target, dim=len(target.shape)-1))

Pose error: P-MPJPE

Reports the error after alignment with the ground truth in translation, rotation, and scale.

p_mpjpe[source]

p_mpjpe(predicted, target)

Pose error: MPJPE after rigid alignment (scale, rotation, and translation), often referred to as "Protocol #2" in many papers.

Mean per joint velocity error

Mean Euclidian distance of the 1:st derivative.

mean_velocity_error[source]

mean_velocity_error(predicted, target)

Mean per-joint velocity error (i.e. mean Euclidean distance of the 1st derivative).

weighted_mpjpe[source]

weighted_mpjpe(predicted, target, w)

Weighted mean per-joint position error (i.e. mean Euclidean distance)

n_mpjpe[source]

n_mpjpe(predicted, target)

Normalized MPJPE (scale only), adapted from: https://github.com/hrhodin/UnsupervisedGeometryAwareRepresentationLearning