immich-app / immich

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

People count doesn't respect minimum recognized faces #13245

Open waclaw66 opened 2 weeks ago

waclaw66 commented 2 weeks ago

The bug

Faces are shown according "Minimum recognized faces" settings, but People count is not affected, it still shows the same count. If minimum is set to 1, faces and count is shown as 161, if minimum is set to 2, 138 faces is shown, count is still 161.

obrazek obrazek

The OS that Immich Server is running on

Fedora 40

Version of Immich Server

v1.117.0

Version of Immich Mobile App

not relevant

Platform with the issue

Your docker-compose.yml content

not relevant

Your .env content

not relevant

Reproduction steps

-

Relevant log output

No response

Additional information

No response

jedi04 commented 2 weeks ago

I tried this and I was also getting the same issue. But when you re run Facial Recognition job for all the assets. It solves this issue.

The query used to fetch count does not consider this option[Minimum Recognized Faces] https://github.com/immich-app/immich/blob/94d213bbb9d882080697d041f4a5b99472bf7db5/server/src/repositories/person.repository.ts#L248

While the query which is used to fetch faces uses this option and that's why count does not match the faces https://github.com/immich-app/immich/blob/94d213bbb9d882080697d041f4a5b99472bf7db5/server/src/repositories/person.repository.ts#L105

jedi04 commented 2 weeks ago

We can use the same filter while fetching the count also. Can i take up this issue?

C-Otto commented 2 weeks ago

@jedi04 sure, go ahead!