I
Immich•2y ago
rbapo

Tagging Missing Objects/Faces/Clips repeats the same photos?

Hey folks, After setting up immich_machine_learning (it's awesome!) I wanted immich to go over and tag my photos with objects/faces/clips. I went into the job status page and clicked on missing for each one of these categories. Immich got a list of photos, tagged them, everything worked beautifully. At the end, each category had 2-8 failures - so I thought I could retry by clicking missing again at the job level. To my surprise - it looked like immich started processing a large number of files similar to the initial jobs. I then repeated the same thing this morning - and again - immich generated a few thousand files for the tag objects/faces jobs. My expectation was that it would only process the delta, did I set up something wrong here?
23 Replies
sogan
sogan•2y ago
hi! could you share some of the logs for the immich_machine_learning container?
rbapo
rbapoOP•2y ago
Looking at it now - it just looks like a ton of detect-faces and tag-image - all of them with a 200 status
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
INFO: my_ip - "POST /image-classifier/tag-image HTTP/1.1" 200 OK
INFO: my_ip - "POST /facial-recognition/detect-faces HTTP/1.1" 200 OK
sogan
sogan•2y ago
if they were successful then it's possible that it's rerunning images that didn't get any tags assigned to them
rbapo
rbapoOP•2y ago
Got it, there's no negative cache? I just did the same thing with objects: - Ran it, waited for completion. - Ran it again - it started from the exact same number.
sogan
sogan•2y ago
if you want to test if this is the reason why, then set MACHINE_LEARNING_MIN_TAG_SCORE=0.0 in your .env and restart the ml container it should pass through all tags from the model without filtering them so all images are guaranteed to get tags
rbapo
rbapoOP•2y ago
I see - once the tags are populated though I'd have no way of removing them I guess?
sogan
sogan•2y ago
i believe if you run "all" it should replace the existing tags
rbapo
rbapoOP•2y ago
I see. Well, since t's working and this behavior seems like immich is working as intended, I think the best thing to do would be to stop messing with it 🙂 It would be nice to cache this information, maybe on the database, so as long as the ML parameters don't change re-running these operations would result in a no-op.
sogan
sogan•2y ago
ah, found the snippet that's causing this
if (tags.length === 0) {
return false;
}
if (tags.length === 0) {
return false;
}
not sure why that's there tbh i'll see if i can make a pr to remove it
rbapo
rbapoOP•2y ago
I guess there's no distinction between having no tags to not even attempting to tag the image? sorry, I haven't looked at the code for this 🙂
sogan
sogan•2y ago
so jobs return true or false on completion, true meaning success and false meaning no-op/failure
rbapo
rbapoOP•2y ago
ah, I got it now. we treat no tags as a failure...
sogan
sogan•2y ago
lol we take "missing" a bit literally
rbapo
rbapoOP•2y ago
yup 🙂 I guess it makes sense for the situation where you tweaked the ml settings like you suggested - then missing would only do the deltas But if I tweaked them I probably want to do everything - not partial Otherwise you’d get search inconsistencies
sogan
sogan•2y ago
true. even better would be to just store the tags and scores and filter internally. that way you wouldn't need to rerun ml at all even if you changed the score threshold.
rbapo
rbapoOP•2y ago
Totally agree - you also need to keep the version of the model in case it changes
sogan
sogan•2y ago
ooh, fair point
rbapo
rbapoOP•2y ago
I think the easiest thing is to pass it as params to the ml container and worst case it just returns a noop
sogan
sogan•2y ago
i plan on making some of the ml settings adjustable from the dashboard. that's probably a good time to make some of these changes since the ml settings would be stored in the server.
rbapo
rbapoOP•2y ago
Awesome 🙂 Thanks a ton for the help on this and the other issues!
sogan
sogan•2y ago
np! ml is changing a lot at the moment so I'm listening pretty closely to feedback
rbapo
rbapoOP•2y ago
I take back what I said about sending the params btw, it would create a lot of network traffic just sending the images
sogan
sogan•2y ago
yeah probably better if the ml server can just focus on inference

Did you find this page helpful?