MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / __call__

Method __call__

tools/test_reconstruction_hf.py:72–79  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
82def get_ssim_metric(device):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected