blissd / fotema

Photo gallery for Linux
60 stars 7 forks source link

Issues with face detection #138

Open forteller opened 1 month ago

forteller commented 1 month ago

Hi. First: Thank you so much for making this! I've been looking for an application to view all my photos on a map for a long time, and not really found anything viable until this. And it looks great too! Fantastic work!

I also love the face detection feature, but have some issues with it that I wanted to open an issue about. I hope it's ok that I address them all here in one issue at first, let me know if you want me to split them up.

  1. To turn on face detection you have to choose for desktop or for mobile. This for me is confusing. What does it mean, why do I have to choose? The first button "Enable for mobile", so I'm like "does that mean if I've taken the photos with a mobile phone, or if I'm doing this on a mobile phone? Can I even use this application on a mobile phone?" then I see the "Enable for desktop" button, and I guess that means the buttons are about where I'm using the app, not how the pictures was taken. But it's still confusing. I feel like there should be some sort of explanation here. What happens if you press the wrong button?
  2. After turning it on, for me it took a long, long time. I started yesterday, it ran for a couple of hours, and the progress bar barely moved. Trying again today it seems like it had to start all over from the beginning again. I let it run for 3-4-5 hours, and the progress bar only got to about 1/4. And I couldn't let it run anymore. After closing the app and restarting it the progress bar then starts from the beginning again. But looking at photos, the application has detected some faces. So it seems to me that the progress bar should continue from where it stopped, not start from the beginning, after restarting the application.
  3. Even though some faces has been detected, and are marked as such when I look at specific photos, the People pane is still just the information about the feature. I would think that it should rather warn me that the detection process has not finished, but still show the photos that it actually has found?
  4. When clicking on a face icon to set a name to a found face, I think that your last used X number of names should be shown in the pop up menu. Also, "Set name" should be lower down than "Ignore", since I'm certain it will be used more, and therefore should have easier access.
  5. Also maybe in that popup menu there should just always be an item for tagging that face as "me"?

Thanks again! I hope this is useful in some way.

blissd commented 1 month ago

Hi @forteller, thank you for your comments. It is definitely OK that you've made comments about Fotema's features!

I'm sorry that the "mobile" and "desktop" choice is confusing. I haven't done a good job explaining what that means in the app. It is for choosing between a lightweight face detection model that is designed for mobile devices, and a heavier weight face detection model that is more suitable for devices that have more processing power. The mobile model is much much faster than the desktop model, but detects fewer faces and often will miss faces that will be quite obvious to you the photo viewer. The desktop model is much better... but several times slower.

You can use Fotema on a mobile devices, and I want all the features to work well on desktop and mobile which is why I added that choice. However, I definitely agree that it is confusing and I would much prefer to not have the choice at all and just have a model that works well everywhere.

There is no wrong button, but I would suggest to always use the desktop option unless you are actually on a low powered device. If you pick the mobile option then fewer faces will be detected and right now if you change your mind there is no way to tell Fotema to rescan all files with the desktop model (though you can update Fotema's database to make this happen and I'm happy to let people know how to do that if necessary). However, Fotema does have a "Scan for more faces" menu option when viewing individual pictures and that always uses the desktop model... but you can only ask Fotema to re-scan one photo at a time that way... and the progress bar displays in that situation but is not actually useful :-(

Yes, face detection is pretty slow. In principle it can be accelerated with a graphics card, but such acceleration is usually for NVidia cards and I don't have one of those to test with, so I haven't tried to enable GPU acceleration.

If you quit Fotema while before face detection has finished, then it will resume from where it got stopped. However, the progress bar only reflects the remaining work to do from the starting point, not from zero.

The people pane shows faces that you've named as people, and you should see people show up there as soon as you give a face a name. However, Fotema won't run the people recognition phase until face detection has completed, so the people albums will be pretty bare until that happens. If you've named faces and don't see them immediately appear in the people album, then that is probably a bug.

Yes, I agree the name selection pop up needs some polish. I'm not overly happy as to how the user experience is right now... but I had to draw a line under it somewhere so I could release it to the world.

I've put a lot of work into face detection but I know that it is not yet very smooth or complete. Hopefully I can find the time to make some improvements. And, of course, PRs are always welcome.

Kimiblock commented 1 month ago

Hmmm... On my machine htop shows fotema barely uses 2% of a CPU core, the progress bar never moved for like half an hour

blissd commented 1 month ago

@Kimiblock Please have a go running Fotema with logging turned up and see if anything interesting is printed:

flatpak run --env=RUST_LOG=fotema=debug --env=RUST_BACKTRACE=1 app.fotema.Fotema
Kimiblock commented 1 month ago

Just tried again but this time the progress bar started to move, weird