slavabarkov / tidy

Offline semantic Text-to-Image and Image-to-Image search on Android powered by quantized state-of-the-art vision-language pretrained CLIP model and ONNX Runtime inference engine
GNU General Public License v3.0
159 stars 13 forks source link

Background index building #3

Open sowa705 opened 11 months ago

sowa705 commented 11 months ago

Hi, a few months ago I implemented some UX features like building the index in the background. Check out my fork: https://github.com/sowa705/AIGallery

slavabarkov commented 10 months ago

@sowa705 Thank you for sharing! That's really cool and I'll definitely take a look at your fork when I have some free time. I like the idea of building the index in the background, but for the scope of this project as of now, I'll probably keep it in foreground to avoid loading the text and visual encoders simultaneously to maintain a lower memory footprint. I think, if I will implement the approximate nearest neighbor search or some sort of memory-mapped array storage for the index, then I would consider in.

sowa705 commented 10 months ago

Hi, is the memory an actual issue? When processing a decently sized gallery you need a high end phone anyway. My 8gb phone seems to handle index building just fine

alnmy commented 10 months ago

I tried out the "AI Gallery" fork and while the background indexing would be really nice for small amounts, it seems to make using the app incredibly slow when indexing large amounts, atleast on my Pixel 7. Maybe putting the indexing to a lower priority somehow would help?

sowa705 commented 10 months ago

That's because the image views are constantly rebuilding as the images get indexed. Shouldn't be hard to fix imo