blissd / fotema

Photo gallery for Linux
81 stars 8 forks source link

Is Face Recognition working? #260

Open Superstreichholzschachtel opened 3 weeks ago

Superstreichholzschachtel commented 3 weeks ago

Hi @blissd , First of all thanks for your work and this nice App.

Please allow me to ask a few questions. 1) Face Recognition: I struggle to figure out how the face recognition works and wonder if it is implemented yet. I installed the app several times and always activated face recognition, but it never recognizes anything. Even after several runs, it always says "No persons found". A lot of persons are facing directly the camera, so I guess it should recognize something. Last time the face recognition process took about 5h, while the PC was running at average 80% CPU. So I think the App is doing "something". I saw a lot of glycin-processes spawn at this time... but still no faces found. What did I do wrong?

2) Size of Thumbs It would be nice to adjust the size of the previews, so that scrolling can be minimized, when using smaller previews.

3) Long scanning after every start of the app: "Files are searched for fotos|videos|..." What is happening there? It takes approx. 35 minutes everytime and I expect the files have already been searched?

4) Files seem to be accessed several times First they are accessed at the initial startup of the app for generating thumbnails. Second time they are accessed for face recognition. At least it seems to me like this, because more than 200 GB network traffic were caused running fotema last time. Maybe it would be better to do "all in one" it it's possible?

Systeminformation: I have appr. 130 GB of family photos stored on a NAS, that is mounted via WLAN to my Zorin OS 17.2 Core running on a personal computer. I'm using fotema in Version 1.15.3 installed with flatpack.

Thanks a lot for your answers and have a nice evening.

blissd commented 3 weeks ago

Hi @Superstreichholzschachtel. Thank you for raising these issues.

Face Recognition

Face recognition is working, but I think there is a failure in UI or UX design on my part that makes the feature confusing. Fotema uses the term "face" to mean a face detected in a photo, and "person" to mean a face that you have given a name to. The "People" album will only be populated if you have given names to faces in photos. After you have done that, the next time Fotema starts it will find faces similar to those you've named and create albums of those faces for you.

Fotema shows a message to this effect before you enable face recognition, but the message disappears after face recognition is enabled and the user is just presented with an empty People album. When the People album is empty, Fotema should probably display a message explaining how to populate the album.

Although face recognition works, I make no claims as to face recognition being fast. Currently it runs on CPU only, but in principle face recognition could be updated to run on your GPU in the future.

Long Scanning

When Fotema starts it starts all the jobs it needs to update itself. The "Scanning For Photo" and "Scanning For Videos" tasks walk your file system to get a list of photo and video files and then updates its database with any new files found. For my 25GB library it takes maybe 15 seconds for each scan. I think the trouble here is that your photos live on a NAS and are being accessed over a network.

The subsequent processing steps only run on unprocessed files, so if your photos are local there is a 10 or 20 second scanning processes, and then Fotema is all done.

Right now photo and video scanning is separate, but I'm sure it could be unified which would hopefully half the file walking time.

I like Fotema scanning for new files at startup, but an setting could be added to make this optional and a menu option added to trigger a scan manually.

Accessing Files Many Times

It is true that Fotema loads the same photo and video files several times during its background processing, and I'm sure this could be more efficient. I think that any given photo will be loaded during thumbnail generation, face recognition, and person recognition. Those steps only need to happen once per photo (well, person recognition can be run over a photo again if a new person is added), but for your library that is hundreds of gigabytes pulled over the network.

I'd hesitate to load a photo once and then run all steps over it, as I'd like the library to be in a displayable state as soon as possible. Right now the library can be displayed right after the file system walking with place holders for thumbnails yet to be generated.

Superstreichholzschachtel commented 3 weeks ago

Hi @blissd , Thank you very much for your detailed answers.

With your explaining I now understood how face recognition worked. After Face Recognition is finished, I opened some single fotos and marked the recognised faces with names. Those "faces" became "persons" then. After that fotema started another scanning and found all other fotos belonging to this person.

Great work. Thanks a lot :)