remove use of tmp_locn, use explicit coords, sizes - partial BUG-108 fix
This commit is contained in:
19
files.py
19
files.py
@@ -664,13 +664,11 @@ def viewlist():
|
|||||||
# put locn data back into array format
|
# put locn data back into array format
|
||||||
fid=0
|
fid=0
|
||||||
for face in e.file_details.faces:
|
for face in e.file_details.faces:
|
||||||
fix_face_locn(face)
|
|
||||||
tmp_locn = json.loads(face.locn)
|
|
||||||
fd= {}
|
fd= {}
|
||||||
fd['x'] = tmp_locn[3]
|
fd['x'] = face.face_left
|
||||||
fd['y'] = tmp_locn[0]
|
fd['y'] = face.face_top
|
||||||
fd['w'] = tmp_locn[1]-tmp_locn[3]
|
fd['w'] = face.w
|
||||||
fd['h'] = tmp_locn[2]-tmp_locn[0]
|
fd['h'] = face.h
|
||||||
if face.refimg:
|
if face.refimg:
|
||||||
fd['who'] = face.refimg.person.tag
|
fd['who'] = face.refimg.person.tag
|
||||||
fd['distance'] = round(face.refimg_lnk.face_distance,2)
|
fd['distance'] = round(face.refimg_lnk.face_distance,2)
|
||||||
@@ -716,14 +714,6 @@ def view(id):
|
|||||||
continue
|
continue
|
||||||
# put locn data back into array format
|
# put locn data back into array format
|
||||||
for face in e.file_details.faces:
|
for face in e.file_details.faces:
|
||||||
if face.locn:
|
|
||||||
fix_face_locn(face)
|
|
||||||
face.tmp_locn = json.loads(face.locn)
|
|
||||||
else:
|
|
||||||
# this at least stops a 500 server error - seems to occur when
|
|
||||||
# DB contains disconnected faces with no locn data - BUG: 87
|
|
||||||
face.tmp_locn = [ 0,0,0,0 ]
|
|
||||||
st.SetMessage( f"For some reason this face does not have a locn: face_id={face.id} tell ddp", "warning" )
|
|
||||||
# now get any relevant override and store it in objs...
|
# now get any relevant override and store it in objs...
|
||||||
fnmo = FaceNoMatchOverride.query.filter(FaceNoMatchOverride.face_id==face.id).first()
|
fnmo = FaceNoMatchOverride.query.filter(FaceNoMatchOverride.face_id==face.id).first()
|
||||||
if fnmo:
|
if fnmo:
|
||||||
@@ -733,7 +723,6 @@ def view(id):
|
|||||||
mo.type = FaceOverrideType.query.filter( FaceOverrideType.name== 'Manual match to existing person' ).first()
|
mo.type = FaceOverrideType.query.filter( FaceOverrideType.name== 'Manual match to existing person' ).first()
|
||||||
face.manual_override=mo
|
face.manual_override=mo
|
||||||
|
|
||||||
|
|
||||||
eids=eids.rstrip(",")
|
eids=eids.rstrip(",")
|
||||||
# jic, sometimes we trip this, and rather than show broken pages / destroy
|
# jic, sometimes we trip this, and rather than show broken pages / destroy
|
||||||
# face locn data, just warn & redirect
|
# face locn data, just warn & redirect
|
||||||
|
|||||||
Reference in New Issue
Block a user