immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
51.38k stars 2.72k forks source link

Faces are identified multiple times or duplicated in the database #10176

Open SimpleUserHA opened 5 months ago

SimpleUserHA commented 5 months ago

The bug

On some pictures, can't tell you why, how to reproduce or so, but when you open the info pane (1) you can see the people that were found. (2) Pressing the edit button opens the edit mode. grafik

In general there were 4 people, but one was hidden so in total 5. However being in the edit mode, suddenly there are not only 5 faces, but acutally 10 faces. each of the 5 is duplicated. On other pictures, I noticed this with 2 additional duplicates (total of 3 of each face).

grafik

The OS that Immich Server is running on

Unraid using docker

Version of Immich Server

v1.105.1

Version of Immich Mobile App

not relevant

Platform with the issue

Your docker-compose.yml content

ghcr.io/imagegenius/immich:latest

Your .env content

ghcr.io/imagegenius/immich:latest

Reproduction steps

actually not sure how to reproduce
1. 
2.
3.
...

Relevant log output

No response

Additional information

No response

Szeraax commented 1 month ago

Happens all the time to me. But its because I have identical twins and they are always getting recognized together. Or consider a picture that has your face in a mirror? Should I only allow one of my kids to get tagged in the photo? Or what?

C-Otto commented 1 month ago

If you hover over duplicates of the same person, do they show up in the same position (with a white border around their face)?

SimpleUserHA commented 1 month ago

Or what?

😆 What!

I have identical twins and they are always getting recognized together. Or consider a picture that has your face in a mirror?

I guess if I would have twins , I would not have opened the issue. Also if a second instance of a person would be in the mirror or another picture on the wall.

If you hover over duplicates of the same person, do they show up in the same position (with a white border around their face)?

Hi @C-Otto , Good point. I did miss to mention it more precisely. The face is listed twice on the side panel like in the screenshot and like described. However the frame /position in the picture is the same, so only one area per "picture group" (all duplicated pictures of one person )

C-Otto commented 1 month ago

If you click on each of the two face/person preview items showing the same face (in the right panel), does it show the same URL? You can also try changing the preview photo for ONE of the duplicates. Does this also change the preview of the other?

Szeraax commented 1 month ago

C-Otto pointed out to me that my issue is NOT related to this one as I have only 1 person in the database but the facial recognition shows 2 instances of it in the picture. Thank you for your time C-Otto!

mertalev commented 1 month ago

I'm not sure what caused the situation in the OP, but the next release will have a mechanism to "refresh" faces for assets. Running that would probably fix this.

chefkoch commented 1 month ago

If you click on each of the two face/person preview items showing the same face (in the right panel), does it show the same URL? You can also try changing the preview photo for ONE of the duplicates. Does this also change the preview of the other?

being at home I tested it now: some of the cases were already gone since I reported the issue. Either I modified or merged faces or partially reimported the pictures from external to internal libraries. However still some case could be found and for those the URL is different for both items on the side panel. Since these are unknown Persons I was able to give it a separate name each. grafik

C-Otto commented 1 month ago

Thanks, that's very helpful! We have two person entities, both of them using the same preview (i.e. the same preview image and the same position in that). These two person entities also share the same face position in other images, as far as I understand the comments. As such, aside from them being two entities, they may be considered identical. I don't know, yet, how the second entity came to be, and I guess this is where the bug is hiding.

Do you know when the two entities (person A and person B) were created? Presumably at the same time? Do you have logs? Can you reproduce this by adding new fotos with new people (maybe some celebrities from Wikipedia or so)? Are you running a somewhat weird/broken ML setup (two docker containers instead of one, outdated version, ....)?

C-Otto commented 1 month ago

Is there any photo with a face that is NOT duplicated? I expect every photo to have two person entities for each real person (like person A and person B). Having a photo where some person is not duplicated would help me find the bug.

Aside from that, is there a photo where this duplication does not happen at all? Did it suddently start for new photos, or does it affect your whole library? If so, when? What's special about the first photos where this happened, vs. those that are unaffected?