diff --git a/TODO b/TODO index 7b80dd3..fa85e7b 100644 --- a/TODO +++ b/TODO @@ -1,14 +1,14 @@ ## GENERAL - * on viewer: - - allow face to be used to: - [DONE] - create person - [DONE] - add to existing person - [DONE] --> can choose to do AI search (for these 2 options) - [DONE] - ignore/not a face/too young - [DONE] - redraw 'ignore's as a greyed out box? - [DONE] - menu should only allow override IF we have put override on... - all NMO's need to handle delete data and rebuild / allow recreation of content form FS (not just test, it causes a bug now / db constraint violation) - --> need to test the 'override' when we re-ai-match (AFTER re-build from FS) + * need force scan on a file as an option in GUI (to test below) + + * keep overrides across 'deletes/rescans' + [DONE] - when we delete/force a full scan then move overrides into disconnected* tables + [PARTIAL] - when an individual face is deleted - need to keep any associated override + code is [DONE] + TEST! (no way to force a delete via gui as yet) + - when we scan a new face, we need to see if there is a matching override, if so, add override back & delete disc* + - TEST (add an override, delete refimg, re-add refimg & re-scan) + - TEST (forcescan job) * should I change the rotation code to use that jpeg util to reduce/remove compression loss? diff --git a/face.py b/face.py index 6ec5f5f..4d839cc 100644 --- a/face.py +++ b/face.py @@ -79,7 +79,6 @@ class FaceNoMatchOverride(db.Model): face_id = db.Column(db.Integer, db.ForeignKey("face.id"), primary_key=True ) type_id = db.Column(db.Integer, db.ForeignKey("face_override_type.id")) type = db.relationship("FaceOverrideType") - face = db.Column( db.LargeBinary ) def __repr__(self): return f"" @@ -89,7 +88,6 @@ class FaceManualOverride(db.Model): __tablename__ = "face_manual_override" id = db.Column(db.Integer, db.Sequence('face_override_id_seq'), primary_key=True ) face_id = db.Column(db.Integer, db.ForeignKey("face.id"), primary_key=True ) - face = db.Column( db.LargeBinary ) person_id = db.Column(db.Integer, db.ForeignKey("person.id"), primary_key=True ) person = db.relationship("Person") diff --git a/pa_job_manager.py b/pa_job_manager.py index 1b6076f..bca405b 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -1,4 +1,4 @@ -### +# # # This file controls the 'external' job control manager, that (periodically # # looks / somehow is pushed an event?) picks up new jobs, and processes them. @@ -360,6 +360,79 @@ class FaceRefimgLink(Base): def __repr__(self): return f"" + +################################################################################ +# Class containing which faces are not ever allowed to match (and the +# type/reason why) +################################################################################ +class FaceNoMatchOverride(Base): + __tablename__ = "face_no_match_override" + id = Column(Integer, Sequence('face_override_id_seq'), primary_key=True ) + face_id = Column(Integer, ForeignKey("face.id"), primary_key=True ) + type_id = Column(Integer, ForeignKey("face_override_type.id")) + type = relationship("FaceOverrideType") + + def __repr__(self): + return f"" + + +################################################################################ +# Class containing a manual / forced match of a face in a file to a person +################################################################################ +class FaceManualOverride(Base): + __tablename__ = "face_manual_override" + id = Column(Integer, Sequence('face_override_id_seq'), primary_key=True ) + face_id = Column(Integer, ForeignKey("face.id"), primary_key=True ) + person_id = Column(Integer, ForeignKey("person.id"), primary_key=True ) + person = relationship("Person") + + def __repr__(self): + return f"" + + +################################################################################ +# Class describing DisconnectedNoMatchOverride in the database and DB via +# sqlalchemy - Used when a face with an override is deleted from the DB to keep +# the raw data so that we can reconnect the override if we ever scan that same +# file/face again (think delete/undelete file, rebuild DB from file sys/from +# scratch, etc) +# used specifically for a face that should not ever be a match +################################################################################ +class DisconnectedNoMatchOverride(Base): + __tablename__ = "disconnected_no_match_override" + face = Column( LargeBinary, primary_key=True ) + type_id = Column(Integer, ForeignKey("face_override_type.id")) + + def __repr__(self): + return f"