PyTorch native metrics library providing 400+ rigorously tested metrics across classification, regression, audio, image, text, and other ML domains
Metrics for analyzing geometric shapes and spatial configurations, useful for computer graphics, 3D modeling, and shape analysis applications.
Metrics for comparing and analyzing geometric shape configurations.
class ProcrustesDisparity(Metric):
def __init__(
self,
**kwargs
): ...import torch
from torchmetrics.shape import ProcrustesDisparity
# Procrustes analysis for shape comparison
procrustes = ProcrustesDisparity()
# Sample 3D point clouds or 2D shapes
# Shape: (batch, points, dimensions)
preds = torch.randn(4, 50, 3) # 4 shapes, 50 points each, 3D coordinates
target = torch.randn(4, 50, 3)
# Compute shape disparity after optimal alignment
disparity = procrustes(preds, target)
print(f"Procrustes Disparity: {disparity:.4f}")ShapePoints = Tensor # Shape: (batch, points, dimensions)Install with Tessl CLI
npx tessl i tessl/pypi-torchmetrics