why you check the range of inputs when calculate lpips? #2233
Unanswered
zealousfool
asked this question in
CompVision
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I found this function, when calculate lpips metrics.
def _valid_img(img: Tensor, normalize: bool) -> bool:
"""Check that input is a valid image to the network."""
value_check = img.max() <= 1.0 and img.min() >= 0.0 if normalize else img.min() >= -1
return img.ndim == 4 and img.shape[1] == 3 and value_check # type: ignore[return-value]
I think a lot of models don't return the [-1,1] or [0,1] as image output, so why do we have to check the range of inputs when calculate lpips?
Beta Was this translation helpful? Give feedback.
All reactions