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

Option to output result embeddings #194

Open
hwazni opened this issue Oct 13, 2022 · 8 comments
Open

Option to output result embeddings #194

hwazni opened this issue Oct 13, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@hwazni
Copy link

hwazni commented Oct 13, 2022

Hello, I would like to know if it's possible to get the image embeddings with a text query. For instance, text: an image of a cat, and the output would be all the image embeddings before using them in KNN. Thanks :)

@rom1504
Copy link
Owner

rom1504 commented Oct 13, 2022

The flow is like this

  1. Text
  2. Text embedding
  3. Knn
  4. IDs that match specific items in image embedding index
  5. Image embeddings or metadata (url, text)

Which embedding are you interested in ? Step 2 or 5 ?

@hwazni
Copy link
Author

hwazni commented Oct 13, 2022

I am interested in the image embeddings of step 5.. Thanks.

@rom1504 rom1504 changed the title Get image embeddings from text Option to output result embeddings Oct 13, 2022
@rom1504
Copy link
Owner

rom1504 commented Oct 13, 2022

Ok yeah, that could totally be added. The embeddings are already available in the back there https://github.com/rom1504/clip-retrieval/blob/main/clip_retrieval/clip_back.py#L375

Would just need to return them in the API

@hwazni
Copy link
Author

hwazni commented Oct 13, 2022

Is it possible to edit the backend results ? or print the embeddings ..

@rom1504
Copy link
Owner

rom1504 commented Oct 13, 2022

You can make a PR to add the feature to return the embeddings in the API

@lizhiustc
Copy link

@rom1504 hi, I'm using clip_client.py to query the remote resources (url="https://knn5.laion.ai/knn-service", indice_name="laion5B"). And I also want to get the image embeddings with a text query. Making a PR to add the feature in clip_back is suitable for local data. But this resources is not the local but remote . So would you like to add the feature to return the embeddings for remote query ? Thanks a lot !

@rom1504
Copy link
Owner

rom1504 commented Nov 15, 2022 via email

@lizhiustc
Copy link

Hi, I make a PR to add that feature. #206 (comment)

@rom1504 rom1504 added the enhancement New feature or request label Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants