quick fix/hack for unmatched faces

This commit is contained in:
2022-07-19 21:23:32 +10:00
parent fd79ee2cf4
commit 8646b3b8c2
3 changed files with 27 additions and 31 deletions

11
ai.py
View File

@@ -87,14 +87,15 @@ 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()
imgs={}
for face in faces:
tmp_locn=json.loads(face.locn)
face.tmp_locn=json.loads(face.locn)
f = Entry.query.join(File).join(FaceFileLink).filter(FaceFileLink.face_id==face.id).first()
face.file_eid=f.id
face.url=f.FullPathOnFS()
x=tmp_locn[3]*0.95
y=tmp_locn[0]*0.95
x2=tmp_locn[1]*1.05
y2=tmp_locn[2]*1.05
face.filename=f.name
x=face.tmp_locn[3]*0.95
y=face.tmp_locn[0]*0.95
x2=face.tmp_locn[1]*1.05
y2=face.tmp_locn[2]*1.05
im = Image.open(f.FullPathOnFS())
region = im.crop((x, y, x2, y2))