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

A Question for prompt_template #8

Open
sonstory opened this issue Aug 27, 2024 · 2 comments
Open

A Question for prompt_template #8

sonstory opened this issue Aug 27, 2024 · 2 comments

Comments

@sonstory
Copy link

Hi, firstly let me say thank you for sharing your great research.
I have a question about prompt_template.

When you define prompt_template in the TextEmbedding_Layer function, you form it like ['a bad photo of a {}.', 'a low resolution photo of the {}.', 'a bad photo of the {}.', 'a cropped photo of the {}.'], so why are there only templates that are all realted to anomaly?

Is there a reason why you did't create templates related to normal images?

Thank you.

@caoyunkang
Copy link
Owner

Hi, thanks for your interest and question!

The prompt template is associated with prompt states in

self.prompt_state = [self.prompt_normal, self.prompt_abnormal]
, where the prompt states are utilized to describe normal and abnormal states, respectively. For more details, we would like to kindly guide you to WinCLIP, where you can find more details about the design of prompts.

@sonstory
Copy link
Author

sonstory commented Sep 2, 2024

Thank you for your thoughtful response.
I have an additional question.

In your code implementing WinCLIP, you define the template for prompt as follows.

template_level_prompts = [
    'a cropped photo of the {}',
    'a cropped photo of a {}',
    'a close-up photo of a {}',
    'a close-up photo of the {}',
    'a bright photo of a {}',
    'a bright photo of the {}',
    'a dark photo of the {}',
    'a dark photo of a {}',
    'a jpeg corrupted photo of a {}',
    'a jpeg corrupted photo of the {}',
    'a blurry photo of the {}',
    'a blurry photo of a {}',
    'a photo of a {}',
    'a photo of the {}',
    'a photo of a small {}',
    'a photo of the small {}',
    'a photo of a large {}',
    'a photo of the large {}',
    'a photo of the {} for visual inspection',
    'a photo of a {} for visual inspection',
    'a photo of the {} for anomaly detection',
    'a photo of a {} for anomaly detection'
]

But in AdaCLIP, You just define the template for prompt as follows.

self.prompt_templates = ['a bad photo of a {}.',
    'a low resolution photo of the {}.',
    'a bad photo of the {}.',
    'a cropped photo of the {}.']

In the case of the existing WinCLIP, I think they configured the prompt with both negative and positive meanings, but in AdaCLIP, I think you configured the template only with negative meanings such as low resolution, bad photo, cropped photo.

Is there any reason why you configured the prompt template only with the above format instead of building templates with various types of negative and positive meanings?

Thank you.

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