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 loss #12

Open
ivashmak opened this issue Jan 23, 2024 · 3 comments
Open

LPIPS loss #12

ivashmak opened this issue Jan 23, 2024 · 3 comments

Comments

@ivashmak
Copy link

When using the LPIPS loss, as exemplified in:
https://github.com/amundra15/livehand/blob/release/models/loss.py#L45
https://github.com/amundra15/livehand/blob/release/models/loss.py#L57

LPIPS expects images to be within the -1 to 1 range. Within the forward function, there is a normalize flag that is by default set to False. It normalizes the images to the -1 to 1 range:

        if normalize: # turn on this flag if input is [0,1] so it can be adjusted to [-1, +1]
            in0 = 2 * in0  - 1
            in1 = 2 * in1  - 1

However, in your case, images (rgb, rgb_sr, target) are within the 0 to 1 range. And you did not set normalize flat to True. Is this intentional, or was it perhaps overlooked?

@amundra15
Copy link
Owner

Hi @ivashmak , you are right. This was overlooked during the implementation.

@amundra15
Copy link
Owner

In case you experiment with correct normalization, I would be curious to look at the results.

@ivashmak
Copy link
Author

ivashmak commented Feb 9, 2024

Thanks for reply. Sure, I will let you know if I do this.

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