From 81fea4f6f32cf780de0ce8f58123830799fa2b2d Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 23 Dec 2022 16:04:51 +1100 Subject: [PATCH] remove temporary code to fix faces (move coords from locn to top, right, etc.) --- pa_job_manager.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pa_job_manager.py b/pa_job_manager.py index ae9cedd..91d1e56 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -288,7 +288,6 @@ class Person(Base): # fname: original file name of refimg # face: actual binary of numpy data for this refimg's face (always only 1) # orig*: width/height of original image, because when we show in person, it get scaled -# face_locn: location of ace - we need to know to draw green box around face locn (with orig* above) # thumbnail: image data of actual img. once we load refimg, we only store this data, not the orig file # model_used: which AI model (cnn or hog) used to create face # person: read-only convenience field not in DB, just used in html @@ -302,7 +301,6 @@ class Refimg(Base): created_on = Column(Float) orig_w = Column(Integer) orig_h = Column(Integer) - face_locn = Column(String) face_top = Column(Integer) face_right = Column(Integer) face_bottom = Column(Integer) @@ -327,13 +325,11 @@ class AIModel(Base): ################################################################################ # Class describing Face in the database and DB via sqlalchemy # - face contains the binary version of numpy array so we dont need to recalc it -# - locn is the pixel coords of the face (top, right, bottom, left) ################################################################################ class Face(Base): __tablename__ = "face" id = Column(Integer, Sequence('face_id_seq'), primary_key=True ) face = Column( LargeBinary ) - locn = Column(String) face_top = Column(Integer) face_right = Column(Integer) face_bottom = Column(Integer) @@ -2399,7 +2395,7 @@ def AddFaceToFile( locn_data, face_data, file_eid, model_id, settings ): h = locn_data[2] - locn_data[0] if w < settings.face_size_limit or h < settings.face_size_limit: return - face = Face( face=face_data.tobytes(), locn=json.dumps(locn_data), w=w, h=h, + face = Face( face=face_data.tobytes(), w=w, h=h, face_top=locn_data[0], face_right=locn_data[1], face_bottom=locn_data[2], face_left=locn_data[3] ) session.add(face) session.commit()