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

Extracting CLIP embedding #11

Open
TooManyMatts opened this issue Sep 16, 2024 · 0 comments
Open

Extracting CLIP embedding #11

TooManyMatts opened this issue Sep 16, 2024 · 0 comments

Comments

@TooManyMatts
Copy link

Hi, thanks for sharing the code!

Small question about extracting the clip embedding. Your evals/models/clip.py has a forward method that outputs a tensor of shape:
torch.Size([1, 768, 32, 32])

Is there a straightforward way of extracting a feature vector from your forward function that would return something of shape:
torch.Size([1, 512])

i.e. feature vector that is commonly used? For example, using open_clip you would do:
image_features = model.encode_image(image)

Best,
Matt

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

1 participant