Semantic file search using ImageBind and sqlite-vec
Find a file
2024-07-30 17:58:44 -05:00
ImageBind@3fcf5c9039 Initial commit 2024-07-26 23:03:29 -05:00
.gitmodules Initial commit 2024-07-26 23:03:29 -05:00
client.py Use with to ensure locks released, RPC over Unix socket instead of TCP, start watches ASAP instead of after indexing is done 2024-07-27 22:41:36 +00:00
LICENSE Add GPL license 2024-07-30 17:58:44 -05:00
model.py Initial commit 2024-07-26 23:03:29 -05:00
README.md Recommend TIDY, explain res symlinks some more 2024-07-27 22:44:15 -05:00
requirements.txt Initial commit 2024-07-26 23:03:29 -05:00
server.py Don't index text since it interferes with other results 2024-07-28 02:58:02 +00:00

search

Semantic file search using ImageBind and sqlite-vec

Installation

pip install -r requirements.txt

If you don't need PyTorch with GPU support, first run pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu. During runtime, if you get the error ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor', change functional_tensor to functional.

Usage

This program uses a client-server architecture to watch directories with inotify and keep the model loaded in memory. It takes around 15 seconds to load the model so it wouldn't be great if every query had to wait on that.

Run python server.py DIRS_TO_INDEX to start the server. The server only indexes images, audio, and videos since text files tend to irrelevantly pollute the search results.

Then run python client.py SEARCH_TEXT NUM_RESULTS to get a list of the most similar files. You can pass this list to an image viewer such as Gwenview to view image results. Note that Gwenview doesn't preserve the order of the images. Alternatively, add a third parameter to python client.py and it will symlink res0, res1, and so on to the files on the list. This can be used in conjunction with the Dolphin file manager's integrated terminal to get thumbnails of the search results.

Check out TIDY for a similar awesome program that runs on Android.