unmatched faces now sorts size of face desc, and is slightly prettier -- still slow and only takes you to the file anyway, might optimise that later. still no code to auto deal with unmatched face, but will add some capabilities next. Also, remembered last dir when file_ip/sp/bin. Also throw error if try to find unknown person - happened since I allowed the back/forward.

This commit is contained in:
2022-01-18 20:59:39 +11:00
parent 4c3aae770d
commit de81db9412
11 changed files with 80 additions and 73 deletions

3
ai.py
View File

@@ -91,7 +91,7 @@ def run_ai_on_storage():
@app.route("/unmatched_faces")
@login_required
def unmatched_faces():
faces=Face.query.join(FaceFileLink).join(FaceRefimgLink, isouter=True).filter(FaceRefimgLink.refimg_id==None).limit(10).all()
faces=Face.query.join(FaceFileLink).join(FaceRefimgLink, isouter=True).filter(FaceRefimgLink.refimg_id==None).order_by(Face.h.desc()).limit(10).all()
imgs={}
for face in faces:
face.locn=json.loads("["+face.locn+"]")
@@ -102,6 +102,7 @@ def unmatched_faces():
y=face.locn[0][0]*0.95
x2=face.locn[0][1]*1.05
y2=face.locn[0][2]*1.05
im = Image.open(f.FullPathOnFS())
region = im.crop((x, y, x2, y2))
img_bytearray = io.BytesIO()