-
Notifications
You must be signed in to change notification settings - Fork 880
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 do Instance Retrieval like the demo? #7
Comments
Hi ! To answer your question: the part for instance retrieval is not public, so it is not in this code base. However, the steps to reproduce it are pretty simple: if you have a dataset that you want to retrieve in ("base dataset") and a "query" image, what you need to do is:
It should not be very complicated once you know how to use faiss ! And if the base dataset is relatively small, it should be pretty fast |
The k-NN evaluation code does provide functionality close to that though (with a k-NN classifier). To complement @MarcSzafraniec's answer with a possibly higher-level description of the retrieval process:
For some use cases (e.g. the demo), the above could (and should) be done (partially) offline by first indexing of all the database feature vectors to facilitate subsequent queries. And then querying this index on each request. As noted above, the Faiss library can be used to implement such indexing and search logic. |
It seems there will be 3 output features "x_norm_clstoken","x_norm_patchtokens" and "x_prenorm" which should be used for retrieval? |
For image retrieval, you can directly use : Line 122 in fc49f49
This would probably be the equivalent of the See: |
This is may help small demo |
Closing and keeping track as part of #95. |
Issue Title: How to do Instance Retrieval like the demo?
Issue Description:
Hello, I have recently come across the demo on instance retrieval in this repository, and I'm very interested in implementing a similar feature in my own project. However, I'm having some difficulties understanding the exact steps and required components to achieve this.
Can you please provide some guidance or documentation on how to replicate the instance retrieval functionality as demonstrated in the demo? Specifically, I'd like to know about the following:
I appreciate any help or direction you can provide. Thank you!
The text was updated successfully, but these errors were encountered: