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 get target image embeddings for retrieval with AlphaCLIP? #59

Open
raghav-akridata opened this issue Aug 2, 2024 · 1 comment

Comments

@raghav-akridata
Copy link

Hey!
Is it mandatory to supply the alpha mask for embedding target images? Masking the entire target image with np.ones does not result in a good accuracy for me. Am I missing something?

# prep a white mask
binary_mask = np.ones((336, 336), dtype=np.uint8)
alpha = mask_transform((binary_mask * 255))
alpha = alpha.cuda().unsqueeze(dim=0)

# extract features
with torch.no_grad():
    target_image_features = model.encode_image(target_image, alpha)
@SunzeY
Copy link
Owner

SunzeY commented Aug 18, 2024

check out our demo code, 1 is not the positive threshold for our model.

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