Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPIPS arguments #233

Open
liza-liz opened this issue Dec 12, 2024 · 1 comment
Open

LPIPS arguments #233

liza-liz opened this issue Dec 12, 2024 · 1 comment

Comments

@liza-liz
Copy link

Hello, I am using the lpips in colab environment. With two images, original image and distorted image. I just wanted to know if should I give the orignal image as first argument or as 2nd argument?

lpiqa_metric = pyiqa.create_metric('lpips-vgg+')

.... transform part ....

Calculate LPIPS score
lpips_score = lpiqa_metric(ref_image, orig_image) 

print(f"LPIPS Score: {lpips_score}")

would give me:
LPIPS Score: tensor([[0.5888]])

while,

# Calculate LPIPS score
lpips_score = lpiqa_metric(orig_image, ref_image)

print(f"LPIPS Score: {lpips_score}")

would give me:

LPIPS Score: tensor([[0.5835]])

@chaofengc
Copy link
Owner

chaofengc commented Dec 13, 2024

The first image should be the distorted one, while the second should be the pristine (reference) image.
Note that lpips is symmetric. The improved version, denoted with +, is asymmetric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants