I
Immich•2y ago
darookee

Cannot rerun Facial Recognition

I have a problem that a lot of users seem to have - children getting older. I tried to experiment with the facial recognition settings and found a value that was better but still not the best, so I wanted to optimize it a bit more, but the job cannot be run again. When clicking on ALL in the RECOGNIZE FACES job overview it says that it started, but in the logs these show up and nothing more happens:
immich_postgres | 2023-09-14 07:48:16.006 UTC [48437] ERROR: bind message has 24728 parameter formats but 0 parameters
immich_postgres | 2023-09-14 07:48:16.006 UTC [48437] STATEMENT: SELECT "PersonEntity"."id" AS "PersonEntity_id", "PersonEntity"."createdAt" AS "PersonEntity_createdAt", "PersonEntity"."updatedAt" AS "PersonEntity_updatedAt", "PersonEntity"."ownerId" AS "PersonEntity_ownerId", "PersonEntity"."name" AS "PersonEntity_name", "PersonEntity"."birthDate" AS "PersonEntity_birthDate", "PersonEntity"."thumbnailPath" AS "PersonEntity_thumbnailPath", "PersonEntity"."faceAssetId" AS "PersonEntity_faceAssetId", "PersonEntity"."isHidden" AS "PersonEntity_isHidden" FROM "person" "PersonEntity" WHERE "PersonEntity"."id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18,...
immich_postgres | 2023-09-14 07:48:16.006 UTC [48437] ERROR: bind message has 24728 parameter formats but 0 parameters
immich_postgres | 2023-09-14 07:48:16.006 UTC [48437] STATEMENT: SELECT "PersonEntity"."id" AS "PersonEntity_id", "PersonEntity"."createdAt" AS "PersonEntity_createdAt", "PersonEntity"."updatedAt" AS "PersonEntity_updatedAt", "PersonEntity"."ownerId" AS "PersonEntity_ownerId", "PersonEntity"."name" AS "PersonEntity_name", "PersonEntity"."birthDate" AS "PersonEntity_birthDate", "PersonEntity"."thumbnailPath" AS "PersonEntity_thumbnailPath", "PersonEntity"."faceAssetId" AS "PersonEntity_faceAssetId", "PersonEntity"."isHidden" AS "PersonEntity_isHidden" FROM "person" "PersonEntity" WHERE "PersonEntity"."id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18,...
(I hope this is not a duplicate, but I could not find anything here... 🥴)
19 Replies
Alex Tran
Alex Tran•2y ago
Hmm @DR7 do you think this is related to the recent feature of running facial thumbnail?
darookee
darookeeOP•2y ago
sorry, I forgot to mention, this problem happens in 1.78.0 and I also had it with 1.76.1
DR7
DR7•2y ago
1.76.1 didn't have facial thumbnail regeneration
darookee
darookeeOP•2y ago
the error occurs when clicking this button
No description
darookee
darookeeOP•2y ago
and I'm adjusting these settings
No description
darookee
darookeeOP•2y ago
not sure if this has something to do with thumbnail regeneration 🤷
DR7
DR7•2y ago
(why is it doing a select of 24728 rows with an IN? 😮 ) @darookee how many faces do you have in your library? I'm guessing more than 20k? @Alex could it be that a previous recognition with too low score parameters created a lot of faces, and there is a query somewhere that is not optimized for a large number of rows in the person table?
darookee
darookeeOP•2y ago
Yes, I had the min detection score set lower than default for a few tests. I'm not sure how many faces there are, though. the error message ends with ...$90261, $90262, $90263, $90264) 😬 so maybe clearing out the faces table would 'solve' this?
DR7
DR7•2y ago
as a workaround, probably, you can try. Let's see what Alex thinks
darookee
darookeeOP•2y ago
ok! i just looked at the stats, I guess with 114k pictures there is a possibility to have at leas 25k faces... 😬
No description
DR7
DR7•2y ago
eheh @darookee could you provide a larger log please? Maybe there is some stacktrace that can help us pinpoint the issue
darookee
darookeeOP•2y ago
jup
darookee
darookeeOP•2y ago
there may be duplicte lines - i copied it from the terminal because redirecting logs from docker compose logs does not work for me, for some reason... 🤷
darookee
darookeeOP•2y ago
(i probably could have skipped all those postgres lines... sorry 😬)
sogan
sogan•2y ago
do you remember how low you went? it can find a lot of faces in every image if it's set close enough to 0
darookee
darookeeOP•2y ago
I think I had the 'min detection score' set to 0.5 or 0.6, but the I had the max recognition distance set to 0.3 at some point. a huge part of these 114k photos are two kids growing up, they were detected as the same person at a very young age even with 0.5, so I went lower 😬
sogan
sogan•2y ago
that detection score is fine, but 0.3 for recognition distance is really strict so it'll separate the same person many times. it's a quirk of the current facial clustering we hope to improve. it's because we do recognition on the fly as images are processed, so we don't have the full picture (no pun intended) of how the faces should be clustered into people.
n0n4m3
n0n4m3•2y ago
got the same now, and thinking the new setting will help alot, did you figure it out OP?
darookee
darookeeOP•2y ago
I didn't bother with it (as i'm the only user currently, i'm on my way to transition everyone in the family over from google photos) for quite some time. and after the 1.79 update the whole database was rebuilt and rescanned (because i switched from the 'external import' thing to the external libraries) and the error didn't come up again. i currently have the detection score set to 0.8 and the minimum distance to 0.4 and was satisfied with the result.

Did you find this page helpful?