Calculate LPIPS between two images. Args: img1, img2: Images in range [-1, 1] with shape (B, C, H, W)
(self, img1: torch.Tensor, img2: torch.Tensor)
| 70 | self.model = LPIPS_VTP().to(device).eval() |
| 71 | |
| 72 | def __call__(self, img1: torch.Tensor, img2: torch.Tensor) -> torch.Tensor: |
| 73 | """Calculate LPIPS between two images. |
| 74 | |
| 75 | Args: |
| 76 | img1, img2: Images in range [-1, 1] with shape (B, C, H, W) |
| 77 | """ |
| 78 | with torch.no_grad(): |
| 79 | return self.model(img1, img2) |
| 80 | |
| 81 | |
| 82 | def get_ssim_metric(device): |
nothing calls this directly
no outgoing calls
no test coverage detected