-
-
Notifications
You must be signed in to change notification settings - Fork 45
Reverse image search 2.0 (rebased) #627
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
base: master
Are you sure you want to change the base?
Conversation
|
it appears like the reverse search no longer functions correctly, trying to search for an image using its thumbnail as reverse search image
|
|
I think this should not be merged until opensearch-project/k-NN#2222 is properly addressed |
|
Also, it'd be good to implement a rudimentary form of batching (merge together up to 8 requests or on a 100ms timer?) to improve the efficiency of performing evaluations |
Right, I kinda assumed this would be fixed by now by them. Wow they're slow. Are you sure it's wise to wait and not just do it? This issue seems to have almost zero traction or movement, I'm not convinced that they'll fix it in any sort of reasonable timely manner, and it'd be a shame to potentially hold a feature for months or even years because some other maintainers have other priorities.
Maybe. I'm not convinced that this would ever be a condition that would be met, though, save for some sort of an attack. But in that case, I'd argue a 1 second window is more wise. People already wait several seconds for image upload, what's 1 second more. |
Yes because the reverse search feature will straight up not work properly without it being fixed |
Did you not have a workaround? You mentioned it in the original PR. |
|
The workaround causes incomplete results if there is a separate filter applied. A previous bug (which I am not sure yet if it was fixed) caused the search engine to segfault when rebalancing vector documents between shards. |
Original PR: #401
This PR replaces the old "image intensities" reverse image search, and has come about due to the confluence of several key factors within the past year:
Together, these factors are used to implement a reverse image search system that uses semantic meaning in the images to identify them, rather than their overall appearance. To establish what is meant by this, here are some examples of an original image and matches found when executing on Derpibooru:
The fact that DINOv2 has semantic extraction can be determined through generated attention maps for these images. The code to generate these attention maps can be found in this repository. These have been reprocessed at a higher scale for visibility:
The system works as follows:
Indexing the classification vector using a nested field allows for the possibility of extracting multiple vectors from each image, and the database table has been set up to allow this should it be desired in the future.
I have pre-computed the DINOv2 with registers features for ~3.5M images on Derpibooru, ~400K images on Furbooru, and ~35K images on Tantabus. Batch inference was run on a 3060 Ti using code from this repository, with the entire process heavily bottlenecked by memory copy bandwidth and image decode performance rather than the GPU execution itself. However, the inference code is efficient enough to run on a CPU in less than 0.5 seconds per image, and this is what is implemented in the repository (with the expectation that there will be no GPU requirement on the server).
This PR must not be merged until OpenSearch releases version 2.19, as 2.18 contains a critical bug that prevents the system from working in all cases. Other bugsrelating to filtering may or may not also be fixed in the 2.19 release, but have been worked around for now.
Meow: we're on OpenSearch 3.2.0 now
This PR must also not be merged until its dependents #389 and #400 are merged.Meow: these are merged now
Fixes #331 (method outdated)