immich icon indicating copy to clipboard operation
immich copied to clipboard

fix(server): People count after updating recognized faces count

Open jedi04 opened this issue 1 year ago • 3 comments

This PR fixes #13245

It updates the query used to fetch the total count of people keeping in consideration the recognized faces setting.

jedi04 avatar Oct 08 '24 16:10 jedi04

Thank you for the PR. Can you please run make sql from the root of the project?

alextran1502 avatar Oct 09 '24 15:10 alextran1502

Thank you for the PR. Can you please run make sql from the root of the project?

Sure. I have run the command from root of project.

Thank you

jedi04 avatar Oct 09 '24 15:10 jedi04

@jedi04 This open another series of issues. @alextran1502 Imho this is a workaround on a deeper issue. See #13551

hitech95 avatar Oct 17 '24 15:10 hitech95

Hey @jedi04, I appreciate this has been open for quite a while. Just trying to go through some of our older PRs and cleanup. Is this ready to merge? I did a quick look through and I didn't really understand why you changed the SQL to have a subquery. From a brief look I feel like you could've just changed the HAVING statement to handle the minimum faces setting. Is there any other advantage to changing the query in this way?

zackpollard avatar Nov 13 '24 01:11 zackpollard

@jedi04 This open another series of issues.

Could you expand on what other issues this opens in your eyes?

zackpollard avatar Nov 13 '24 01:11 zackpollard

@jedi04 This open another series of issues.

Could you expand on what other issues this opens in your eyes?

See #13551

hitech95 avatar Nov 13 '24 08:11 hitech95

@jedi04 This open another series of issues.

Could you expand on what other issues this opens in your eyes?

See #13551

I saw that issue but it isn't really clear to me why this fix is directly a problem. It sounds like there are more issues in this area, but this PR feels like a bug regardless, it doesn't need to fix all of the problems. I think it's fine to look to merge this change but also look at a broader solution to the problems you mention separately.

zackpollard avatar Nov 13 '24 10:11 zackpollard

@jedi04 This open another series of issues.

Could you expand on what other issues this opens in your eyes?

See #13551

I saw that issue but it isn't really clear to me why this fix is directly a problem. It sounds like there are more issues in this area, but this PR feels like a bug regardless, it doesn't need to fix all of the problems. I think it's fine to look to merge this change but also look at a broader solution to the problems you mention separately.

This only fix the returned counte of the people, by limiting the real count to those that only have a at least N faces. it does not fix teh underlaying issue that the person is created but the faces are not attached to it.

If I have a person Y with 3 faces the person is created. if I delete one of the pictures the person Y still exist. but the counter will return a lower count (as it dont meet the threshold). I could have already named the person. The result would be still out of sink. As I can still navigate to the person and fetch the related pictures from the timeline.

IMHO: limiting the count is not the correct way to fix this, the correct way is to ensure that the DB is consistent with the data.

hitech95 avatar Nov 13 '24 10:11 hitech95

@jedi04 This open another series of issues.

Could you expand on what other issues this opens in your eyes?

See #13551

I saw that issue but it isn't really clear to me why this fix is directly a problem. It sounds like there are more issues in this area, but this PR feels like a bug regardless, it doesn't need to fix all of the problems. I think it's fine to look to merge this change but also look at a broader solution to the problems you mention separately.

This only fix the returned counte of the people, by limiting the real count to those that only have a at least N faces. it does not fix teh underlaying issue that the person is created but the faces are not attached to it.

If I have a person Y with 3 faces the person is created. if I delete one of the pictures the person Y still exist. but the counter will return a lower count (as it dont meet the threshold). I could have already named the person. The result would be still out of sink. As I can still navigate to the person and fetch the related pictures from the timeline.

IMHO: limiting the count is not the correct way to fix this, the correct way is to ensure that the DB is consistent with the data.

I now understand the issue. In that case I agree, and it's probably better to fix that underlying issue then. In which case I think I will close this issue as it is a bandaid to the wider issue.

zackpollard avatar Nov 13 '24 12:11 zackpollard

Hi,

I have the same issue, but I'm totally lost in finding a solution... What should I do in this case? My minimal face recognition is set to 3... How can I solve the issue?

mlinko6 avatar Nov 25 '24 12:11 mlinko6