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

Request for fine-grained prompts for CLIP-IQA #370

Open
mansur007 opened this issue Jul 17, 2023 · 2 comments
Open

Request for fine-grained prompts for CLIP-IQA #370

mansur007 opened this issue Jul 17, 2023 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@mansur007
Copy link

Is your feature request related to a problem? Please describe.
Currently, CLIP-IQA uses ["Good photo.", "Bad photo."] as anchors.
However, a more fine-grained assessment should be possible according to the paper.
If you refer to the table 3 of the paper, you will see pairs like:
["Clean photo.", "Noisy photo."], ["Sharp photo.", "Blurry photo."], etc.
Would it be possible for such prompts to be supported?

Describe the solution you'd like
In the clip_iqa.py file, pre-computed tokens are downloaded for "Good photo." and "Bad photo.".
Would it be possible to add pre-computed tokens for other prompts as well?
Or, can you suggest a quick way for us to generate those tokens by ourselves?

Thank you!

@mansur007 mansur007 added the feature New feature or request label Jul 17, 2023
@snk4tr snk4tr self-assigned this Jul 20, 2023
@snk4tr
Copy link
Contributor

snk4tr commented Jul 20, 2023

Hello @mansur007!

Indeed, the initial paper mentioned several ways to apply prompt engineering to tune the metric. One way would be to use alternative prompts that you just mentioned, the other way would be to combine (ensemble) several prompts to cover broader scope and potentially improve generalizability.

While those modifications are possible, the choice of a pair of prompts is part of the metric design and firmly fixed. To confirm that, please check tables with comparisons of CLIP-IQA with other metrics, in all of them ["Good photo.", "Bad photo."] are used as anchors. Hence, we fixed the pair of prompts for users' convenience so their results reproduce the actual CLIP-IQA metric.

However, your proposition makes sense. Potentially, a user may want to use alternative pairs of prompts. We will support this functionality ASAP. For the moment, there is no elegant solution to your problem. I can only recommend you to clone the repo and modify prompts in the clipiqa.py file.

@mansur007
Copy link
Author

@snk4tr Thank you for the info!
I don't know how to generate tokens for other prompts. Would you be able to guide me/point me to some resources I could use to generate tokens for custom prompts?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
2 participants