(
ground_truth: Float[Tensor, "batch channel height width"],
predicted: Float[Tensor, "batch channel height width"],
)
| 26 | |
| 27 | @torch.no_grad() |
| 28 | def 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() |
no test coverage detected