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

Image retrieval / similarity #6

Closed
johnyquest7 opened this issue Oct 14, 2020 · 1 comment
Closed

Image retrieval / similarity #6

johnyquest7 opened this issue Oct 14, 2020 · 1 comment

Comments

@johnyquest7
Copy link

Thanks for this great resource.
Planning to play with your cats and dog example.
I am wondering whether this approach could be used for image retrieval / image similarity?
Have you looked into it?

@lucidrains
Copy link
Owner

@johnyquest7 hey Johnson! yea absolutely! It works like any other neural net. You can take the embedding (usually the output at the very last attention layer) https://github.com/lucidrains/vit-pytorch/blob/main/vit_pytorch/vit_pytorch.py#L113 and use your favorite nearest neighbor library (for example, Faiss https://github.com/facebookresearch/faiss) and you've got yourself retrieval

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