0
# Shape Metrics
1
2
Metrics for analyzing geometric shapes and spatial configurations, useful for computer graphics, 3D modeling, and shape analysis applications.
3
4
## Capabilities
5
6
### Shape Analysis
7
8
Metrics for comparing and analyzing geometric shape configurations.
9
10
```python { .api }
11
class ProcrustesDisparity(Metric):
12
def __init__(
13
self,
14
**kwargs
15
): ...
16
```
17
18
## Usage Examples
19
20
```python
21
import torch
22
from torchmetrics.shape import ProcrustesDisparity
23
24
# Procrustes analysis for shape comparison
25
procrustes = ProcrustesDisparity()
26
27
# Sample 3D point clouds or 2D shapes
28
# Shape: (batch, points, dimensions)
29
preds = torch.randn(4, 50, 3) # 4 shapes, 50 points each, 3D coordinates
30
target = torch.randn(4, 50, 3)
31
32
# Compute shape disparity after optimal alignment
33
disparity = procrustes(preds, target)
34
print(f"Procrustes Disparity: {disparity:.4f}")
35
```
36
37
## Types
38
39
```python { .api }
40
ShapePoints = Tensor # Shape: (batch, points, dimensions)
41
```