feat(S3): face_profiles, face_embeddings, visits tables
Add three new SQLAlchemy Core tables to schema.py for visitor recognition: face_profiles (identity store), face_embeddings (per-profile encodings), and visits (arrival/departure log). Indexes on profile_id and arrived_at. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6b7adc1cb6
commit
37beb92467
@ -210,3 +210,42 @@ pet_rules = Table(
|
||||
Column("created_at", Float, nullable=False),
|
||||
)
|
||||
Index("idx_pet_rules_pet", pet_rules.c.pet_id, pet_rules.c.enabled, pet_rules.c.priority)
|
||||
|
||||
face_profiles = Table(
|
||||
"face_profiles", metadata,
|
||||
Column("id", Integer, primary_key=True, autoincrement=True),
|
||||
Column("name", String),
|
||||
Column("is_household", Integer, nullable=False, default=0),
|
||||
Column("presence_member", String),
|
||||
Column("primary_photo_path", String),
|
||||
Column("visit_count", Integer, nullable=False, default=0),
|
||||
Column("first_seen_at", Float, nullable=False),
|
||||
Column("last_seen_at", Float, nullable=False),
|
||||
Column("ignored", Integer, nullable=False, default=0),
|
||||
Column("created_at", Float, nullable=False),
|
||||
)
|
||||
Index("idx_face_profiles_name", face_profiles.c.name)
|
||||
|
||||
face_embeddings = Table(
|
||||
"face_embeddings", metadata,
|
||||
Column("id", Integer, primary_key=True, autoincrement=True),
|
||||
Column("profile_id", Integer, nullable=False),
|
||||
Column("embedding", Text, nullable=False),
|
||||
Column("crop_path", String),
|
||||
Column("camera_id", String, nullable=False),
|
||||
Column("captured_at", Float, nullable=False),
|
||||
)
|
||||
Index("idx_face_embeddings_profile", face_embeddings.c.profile_id)
|
||||
|
||||
visits = Table(
|
||||
"visits", metadata,
|
||||
Column("id", Integer, primary_key=True, autoincrement=True),
|
||||
Column("profile_id", Integer, nullable=False),
|
||||
Column("camera_id", String, nullable=False),
|
||||
Column("arrived_at", Float, nullable=False),
|
||||
Column("departed_at", Float),
|
||||
Column("duration_s", Float),
|
||||
Column("event_id", Integer),
|
||||
)
|
||||
Index("idx_visits_profile_ts", visits.c.profile_id, visits.c.arrived_at.desc())
|
||||
Index("idx_visits_ts", visits.c.arrived_at.desc())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user