MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / compute_lpips

Function compute_lpips

utils/metrics.py:28–33  ·  view source on GitHub ↗
(
    ground_truth: Float[Tensor, "batch channel height width"],
    predicted: Float[Tensor, "batch channel height width"],
)

Source from the content-addressed store, hash-verified

26
27@torch.no_grad()
28def compute_lpips(
29 ground_truth: Float[Tensor, "batch channel height width"],
30 predicted: Float[Tensor, "batch channel height width"],
31) -> Float[Tensor, " batch"]:
32 value = get_lpips(predicted.device).forward(ground_truth, predicted, normalize=True)
33 return value[:, 0, 0, 0]
34
35
36@torch.no_grad()

Callers 2

forwardMethod · 0.90
compute_lossesMethod · 0.90

Calls 2

get_lpipsFunction · 0.85
forwardMethod · 0.45

Tested by

no test coverage detected