updated comments

This commit is contained in:
2021-08-10 21:31:09 +10:00
parent d49af24fee
commit 03a2b4a9d9
2 changed files with 24 additions and 5 deletions

22
face.py
View File

@@ -2,6 +2,16 @@ from main import db, app, ma
from sqlalchemy import Sequence
from sqlalchemy.exc import SQLAlchemyError
# pylint: disable=no-member
################################################################################
# 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)
# - refimg_lnk and facefile_lnk are viewOnly / just for convenience in viewer
# - refimg is a real link to the refimg used for this face (its is only used in
# viewer, and is either set when there is a matched face, or None if no match
################################################################################
class Face(db.Model):
__tablename__ = "face"
id = db.Column(db.Integer, db.Sequence('face_id_seq'), primary_key=True )
@@ -14,6 +24,13 @@ class Face(db.Model):
def __repr__(self):
return f"<id: {self.id}, face={self.face}, locn={self.locn}"
################################################################################
# Class describing FaceFileLink in the database and DB via sqlalchemy
# each face comes from a file and used a model to find the face
# this is not perfect, each face in the same file is always foudn with the same
# model - so really should have ModelFileLink or something, in the long run
# this might even be better as ScanDetailsFileLink and ScanDetails
################################################################################
class FaceFileLink(db.Model):
__tablename__ = "face_file_link"
face_id = db.Column(db.Integer, db.ForeignKey("face.id"), primary_key=True )
@@ -23,6 +40,11 @@ class FaceFileLink(db.Model):
def __repr__(self):
return f"<face_id: {self.face_id}, file_eid={self.file_eid}, model_used: {self.model_used}"
################################################################################
# Class describing FaceRefimgLink in the database and DB via sqlalchemy
# connects / implies a face has matched a refimg and we keep the distance too
# distance is mainly for debugging for now and shown in viewer
################################################################################
class FaceRefimgLink(db.Model):
__tablename__ = "face_refimg_link"
face_id = db.Column(db.Integer, db.ForeignKey("face.id"), primary_key=True )