remove temporary code to fix faces (move coords from locn to top, right, etc.)
This commit is contained in:
@@ -288,7 +288,6 @@ class Person(Base):
|
|||||||
# fname: original file name of refimg
|
# fname: original file name of refimg
|
||||||
# face: actual binary of numpy data for this refimg's face (always only 1)
|
# 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
|
# 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
|
# 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
|
# model_used: which AI model (cnn or hog) used to create face
|
||||||
# person: read-only convenience field not in DB, just used in html
|
# person: read-only convenience field not in DB, just used in html
|
||||||
@@ -302,7 +301,6 @@ class Refimg(Base):
|
|||||||
created_on = Column(Float)
|
created_on = Column(Float)
|
||||||
orig_w = Column(Integer)
|
orig_w = Column(Integer)
|
||||||
orig_h = Column(Integer)
|
orig_h = Column(Integer)
|
||||||
face_locn = Column(String)
|
|
||||||
face_top = Column(Integer)
|
face_top = Column(Integer)
|
||||||
face_right = Column(Integer)
|
face_right = Column(Integer)
|
||||||
face_bottom = Column(Integer)
|
face_bottom = Column(Integer)
|
||||||
@@ -327,13 +325,11 @@ class AIModel(Base):
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Class describing Face in the database and DB via sqlalchemy
|
# 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
|
# - 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):
|
class Face(Base):
|
||||||
__tablename__ = "face"
|
__tablename__ = "face"
|
||||||
id = Column(Integer, Sequence('face_id_seq'), primary_key=True )
|
id = Column(Integer, Sequence('face_id_seq'), primary_key=True )
|
||||||
face = Column( LargeBinary )
|
face = Column( LargeBinary )
|
||||||
locn = Column(String)
|
|
||||||
face_top = Column(Integer)
|
face_top = Column(Integer)
|
||||||
face_right = Column(Integer)
|
face_right = Column(Integer)
|
||||||
face_bottom = 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]
|
h = locn_data[2] - locn_data[0]
|
||||||
if w < settings.face_size_limit or h < settings.face_size_limit:
|
if w < settings.face_size_limit or h < settings.face_size_limit:
|
||||||
return
|
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] )
|
face_top=locn_data[0], face_right=locn_data[1], face_bottom=locn_data[2], face_left=locn_data[3] )
|
||||||
session.add(face)
|
session.add(face)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user