Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/om1_vlm/anonymizationSys/face_recog_stream/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ def main() -> None:
logger.info("Starting realtime_stream...")

script_dir = os.path.dirname(os.path.abspath(__file__))
models_dir = os.path.join(script_dir, "..", "engine")
models_dir = os.path.join(script_dir, "..", "engines")

platform_prefix = get_platform_prefix()
scrfd_name = f"{platform_prefix}_scrfd_10g.engine"
arc_name = f"{platform_prefix}_adaface_ir101.engine"
pose_name = "yolo11s-pose.engine"
pose_name = f"{platform_prefix}_yolo11s-pose.engine"

default_scrfd_engine = os.path.join(models_dir, scrfd_name)
default_arc_engine = os.path.join(models_dir, arc_name)
Expand Down
19 changes: 19 additions & 0 deletions src/om1_vlm/anonymizationSys/face_recog_stream/who_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ class FallInfo:

identity: Optional[str] # Matched face name or None
is_fallen: bool
bbox: Tuple[float, float, float, float] = (
0.0,
0.0,
0.0,
0.0,
) # x1, y1, x2, y2 (pose bbox = full body)
confidence: float = 0.0 # Fall detection confidence (0-1)


def _expand_bbox(bbox, margin: float):
Expand Down Expand Up @@ -113,6 +120,8 @@ def match_falls_to_faces(
FallInfo(
identity=matched_identity,
is_fallen=status.is_fallen,
bbox=tuple(float(x) for x in status.bbox), # type: ignore
confidence=float(status.confidence),
)
)

Expand Down Expand Up @@ -312,9 +321,18 @@ def is_named(x: str) -> bool:

# ----- Fall detection (unchanged) -----
fallen_now: List[str] = []
fallen_now_details: List[Dict] = (
[]
) # name + bbox + confidence per fallen person
fallen_unknown_now = 0
for fall in now_falls:
if fall.is_fallen:
detail = {
"name": fall.identity if fall.identity else "unknown",
"bbox": list(fall.bbox),
"confidence": float(fall.confidence),
}
fallen_now_details.append(detail)
if fall.identity and fall.identity != "unknown":
if fall.identity not in fallen_now:
fallen_now.append(fall.identity)
Expand Down Expand Up @@ -360,6 +378,7 @@ def is_named(x: str) -> bool:
"unknown_recent": int(unknown_recent_peak),
# Fall detection (unchanged)
"fallen_now": fallen_now,
"fallen_now_details": fallen_now_details,
"fallen_now_count": len(fallen_now) + fallen_unknown_now,
"fallen_unknown_now": fallen_unknown_now,
"fallen_recent": fallen_recent,
Expand Down
Loading