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

How to extract background image features #23

Open
cjf-repo opened this issue May 14, 2023 · 4 comments
Open

How to extract background image features #23

cjf-repo opened this issue May 14, 2023 · 4 comments

Comments

@cjf-repo
Copy link

cjf-repo commented May 14, 2023

When calculating the cosine similarity between the background and text, only the features of the background are extracted? and How to delete the features of the foreground objects? I try to make the foreground object black in the image, and keep the background ,but sometimes CLIP still recognizes that object and make a high scores. So I do not know how did you extract image features from the background of the image.
image

@cjf-repo cjf-repo changed the title 怎么让这个L(BT《) 怎么让这个L(BTM)减小? May 14, 2023
@cjf-repo cjf-repo changed the title 怎么让这个L(BTM)减小? How to extract background image features May 14, 2023
@Sierkinhane
Copy link
Member

Hi, during training, we use a soft activation map (1-pk) to mask out background regions, i.e., (1-pk) * x. With the L_BTM loss, pk will be optimized to only activate the background regions.

@cjf-repo
Copy link
Author

Hi, during training, we use a soft activation map (1-pk) to mask out background regions, i.e., (1-pk) * x. With the L_BTM loss, pk will be optimized to only activate the background regions.

Ok,thank you! The specific approach is to generate the initial CAMs p, and then use this (1-p) to multiply with image x to mask out the foreground object. From the perspective of the image matrix, this make the pixel value of the foreground object smaller and the pixel value of the background larger to mask out the foreground object, right? Is there any deficiency in my understanding of this?

@Sierkinhane
Copy link
Member

Sierkinhane commented May 15, 2023

Exactly. p should be normalized into [0,1] by sigmoid.
Btw, welcome to star CLIMS. :)

@cjf-repo
Copy link
Author

Exactly. p should be normalized into [0,1] by sigmoid. Btw, welcome to star CLIMS. :)

Thank you! I have starred CLIMS.

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