fixed BUG-105, unmatched faces now ignores overridden faces

This commit is contained in:
2023-01-02 22:42:22 +11:00
parent 5db204d72c
commit 06846b86c5
2 changed files with 5 additions and 3 deletions

1
BUGs
View File

@@ -1,7 +1,6 @@
### Next: 112 ### Next: 112
BUG-100: I managed to get 2 photos matching mich in the NOT_WORKING photo (probably dif refimgs but same p.tag?) BUG-100: I managed to get 2 photos matching mich in the NOT_WORKING photo (probably dif refimgs but same p.tag?)
= /photos/2012/20120414-damien/IMG_8467.JPG = /photos/2012/20120414-damien/IMG_8467.JPG
BUG-105: show unmatched needs to handle overrides (ignore face, etc.)
BUG-106: cant add trudy /pat? as refimgs via FaceDBox BUG-106: cant add trudy /pat? as refimgs via FaceDBox
- seems the cropped trudy face is not sufficient to find a face, how odd... - seems the cropped trudy face is not sufficient to find a face, how odd...
(it came from a face bbox, BUT, I have grown the face seln by 10%?) (it came from a face bbox, BUT, I have grown the face seln by 10%?)

7
ai.py
View File

@@ -14,7 +14,7 @@ import io
import base64 import base64
from job import Job, JobExtra, Joblog, NewJob from job import Job, JobExtra, Joblog, NewJob
from face import Face, FaceFileLink, FaceRefimgLink from face import Face, FaceFileLink, FaceRefimgLink, FaceNoMatchOverride, FaceForceMatchOverride
# pylint: disable=no-member # pylint: disable=no-member
@@ -82,7 +82,10 @@ def run_ai_on_storage():
@app.route("/unmatched_faces", methods=["GET"]) @app.route("/unmatched_faces", methods=["GET"])
@login_required @login_required
def unmatched_faces(): def unmatched_faces():
faces=Face.query.join(FaceFileLink).join(FaceRefimgLink, isouter=True).filter(FaceRefimgLink.refimg_id==None).order_by(Face.h.desc()).limit(10).all() # get overrides and exclude them as they have been processed already
fnmo_ids = [id[0] for id in FaceNoMatchOverride.query.with_entities(FaceNoMatchOverride.face_id).all()]
fmo_ids = [id[0] for id in FaceForceMatchOverride.query.with_entities(FaceForceMatchOverride.face_id).all()]
faces=Face.query.join(FaceFileLink).join(FaceRefimgLink, isouter=True).filter(FaceRefimgLink.refimg_id==None).filter(Face.id.not_in(fnmo_ids+fmo_ids)).order_by(Face.h.desc()).limit(10).all()
imgs={} imgs={}
for face in faces: for face in faces:
f = Entry.query.join(File).join(FaceFileLink).filter(FaceFileLink.face_id==face.id).first() f = Entry.query.join(File).join(FaceFileLink).filter(FaceFileLink.face_id==face.id).first()