fix: add min_capture_quality to FaceFilterSettings + trace profile fixes
- Add min_capture_quality to FaceFilterSettings (file_profile.rs) - Fix store_traced_faces.py: load embeddings from Qdrant with_vector=True - Fix face_tracker.py: force new traces when frame_gap > 30 - Fix backfill_trace_profiles.py: key_frame select=eq(n,N), bbox scaling, best_frame - Add best_frame to FaceTraceProfile (Rust + Python) - Fix min_capture_quality persistence in file-profile API
This commit is contained in:
@@ -123,7 +123,16 @@ class FaceProcessorVision:
|
||||
"""
|
||||
print(f"[FACE_V2] Step 1: Vision detection (face only)...")
|
||||
|
||||
# Build swift_face if needed
|
||||
# Build swift_face if missing or stale (source newer than binary)
|
||||
src = os.path.join(SCRIPT_DIR, "swift_processors", "swift_face.swift")
|
||||
def _stale(bin_path):
|
||||
return os.path.exists(bin_path) and os.path.exists(src) and \
|
||||
os.path.getmtime(src) > os.path.getmtime(bin_path)
|
||||
if _stale(SWIFT_BIN):
|
||||
print(f"[FACE_V2] swift_face release binary stale (source newer), removing to force rebuild...")
|
||||
os.remove(SWIFT_BIN)
|
||||
if _stale(SWIFT_BIN_DEBUG):
|
||||
os.remove(SWIFT_BIN_DEBUG)
|
||||
if not os.path.exists(SWIFT_BIN) and not os.path.exists(SWIFT_BIN_DEBUG):
|
||||
build_dir = os.path.join(SCRIPT_DIR, "swift_processors")
|
||||
print(f"[FACE_V2] Building swift_face in {build_dir}...")
|
||||
@@ -147,7 +156,8 @@ class FaceProcessorVision:
|
||||
cmd.extend(["--uuid", self.uuid])
|
||||
|
||||
print(f"[FACE_V2] Running: {' '.join(cmd)}")
|
||||
# Log face detection settings being passed to swift_face
|
||||
# Log face detection settings being passed to swift_face.
|
||||
# Defaults mirror src/core/config.rs FACE_MIN_CONFIDENCE_DEFAULT / FACE_MIN_SIZE_DEFAULT (0.5 / 1).
|
||||
min_conf = os.environ.get("FACE_MIN_CONFIDENCE", "not set (default 0.5)")
|
||||
min_size = os.environ.get("FACE_MIN_SIZE", "not set (default 1)")
|
||||
print(f"[FACE_V2] Settings passed to swift_face: FACE_MIN_CONFIDENCE={min_conf}, FACE_MIN_SIZE={min_size}")
|
||||
@@ -250,6 +260,7 @@ class FaceProcessorVision:
|
||||
"trace_id": face_idx, # Use face_idx as unique identifier within frame
|
||||
"bbox": {"x": x, "y": y, "width": w, "height": h},
|
||||
"confidence": face.get("confidence", 0.5),
|
||||
"capture_quality": face.get("captureQuality", 0),
|
||||
"embedding": emb,
|
||||
})
|
||||
|
||||
@@ -263,6 +274,7 @@ class FaceProcessorVision:
|
||||
faces.append({
|
||||
"x": x, "y": y, "width": w, "height": h,
|
||||
"confidence": face.get("confidence", 0.5),
|
||||
"captureQuality": face.get("captureQuality", 0),
|
||||
"pose_angle": {
|
||||
"angle": pose_angle,
|
||||
"roll": pose_info.get("roll", 0),
|
||||
|
||||
Reference in New Issue
Block a user