FossifyOrg / Gallery

Browse your memories without any interruptions with this photo and video gallery
https://www.fossify.org
GNU General Public License v3.0
1.46k stars 42 forks source link

integrate offline LLM for searching media in gallery #19

Open shamirahim111 opened 8 months ago

shamirahim111 commented 8 months ago

Checklist

Is your feature request related to a problem? Please describe. there is no "LLM" or the buzzword "AI" in gallery. While this might be difficult to do on its own, there is a real problem of finding photos of something i took last month or photos of a friend or something.

Describe the solution you'd like https://github.com/slavabarkov/tidy this app exists and i've been using it for quite some time and it is very nice. the UX is "not" up to the quality of gallery so i was hoping if tidy could be integrated in gallery itself so that you can use the existing search that you have and the app would filter results. That's all i am asking for.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

naveensingh commented 8 months ago

We'll maybe do this eventually once there are more lightweight and efficient solutions available for this (I'm yet to do any actual research on this but a lighter solution shouldn't take long given the pace things are advancing).

I haven't done any work with Open AI clip specifically (used by tidy): The tidy APK is 157MB so I'm guessing the model that is being used for this is too big even after quantization. I think most people do not want to download a 150MB gallery even if storage and bandwidth are relatively cheap now a days.

We could try this as an extension app for Gallery if enough people want it.

shamirahim111 commented 8 months ago

@naveensingh i understand the idea but i for one really "desire" this feature. how about a setting inside the app itself that downloads the model and does its thing?

shamirahim111 commented 8 months ago

https://github.com/FossifyOrg/Gallery/discussions/20

have started a poll

jherazob commented 7 months ago

I started using Simple Gallery because it was A SIMPLE GALLERY APP, adding this kind of thing is blatantly unnecessary bloat, the example you mention is 157Mb! And there's no reducing this any further, it's a fundamentally heavy application completely unnecessary for the tasks of A SIMPLE GALLERY APP.

test2a commented 7 months ago

@jherazob i would say the gallery job itself is being done nicely so like @naveensingh is saying, maybe we can do this as an extension app outside of the normal app so that people who need the enhanced functionality can still continue to use the app

johnnynoone commented 7 months ago

@shamirahim111 I like the idea of optionally downloading the model in the settings. This way language-specific models can be offered in the future - not everyone speaks English.

GfEW commented 6 months ago

Agreed, if you decide to include such "useful bloat" (even if it's become lighter by then), please make it modular.

I'd like to add that "AI" search is not only heavier than, but also not generally superior to strict pattern matching. Just think of finding (or counting, examining, sharing etc.) all items that exactly match your carefully crafted search input, in any LLM driven search - you'll have a hard time.

Therefore, even when the user activates LLM search, strict pattern matching should remain available at hand, without jumping through hoops (like e. g. first having to dive into settings, find the appropriate option there, change it, leave settings, to finally being able to perform the actual search).

inson1 commented 6 months ago

@johnnynoone you cant do that, the app would need internet access, it has to be another app

EDIT max link would be possible

haldi4803 commented 6 months ago

Here is another example of a fullfetched Gally with included CLIP search. https://github.com/greyovo/PicQuery

I think that (or similar) needs to be included in any gallery in the "Future". The Question is would that be now, in 2 years or in 5 years.

inson1 commented 6 months ago

yes, but the app is huge 175 mb apk, how much would be the app? 350-400 mb? that has to be different and optional app

or wait for smaller size

haldi4803 commented 6 months ago

or... sepparate loading of AI model.

inson1 commented 6 months ago

@haldi4803 from where? No internet access

haldi4803 commented 6 months ago

The Manual way... download the CLIP file you want from huggingface, and then select it in the app from the download location. But that would be more than just "simple"

inson1 commented 6 months ago

@haldi4803 yea I guess the easiest way is to wait (as there is lot of work elsewhere anyway) or second app with it

johnnynoone commented 6 months ago

@johnnynoone you cant do that, the app would need internet access, it has to be another app

Oh, right. Then perhaps an extension installed separately from F-Droid? Just like the "OsmAnd Contour lines" extension for OsmAnd? Then it could be used in multiple Fossify apps, e.g. in the file manager.