move_detect/edge
유창욱 9e4225a338 feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay
Heinrich's-law play: the signals we already compute but used to throw away
become a spatial risk map of the workplace, drawn over the camera's own frame.

Edge:
- near_fall (INFO): a track that reached FALLING (sustained prone) but recovered
  before the FALLEN confirm. Treated as a full event per product decision -
  same ingest, snapshots, dedup, ack flow as incidents. Fix en route: prone_s
  used a truthiness check that turned prone_since=0.0 into "no timer".
- Every per-track event (fall/no_motion/near_fall/immobility/zone hits) now
  carries the foot point in the zones' normalized 0..1 space (reusing the zone
  detector's own coordinate math); ghost's pixel-space loss point is normalized
  at emit. to_payload omits the key when absent, so an old server ignores it.

Server:
- move_events.spatial_x/spatial_y (nullable DOUBLE) + validator: optional
  [x, y] finite-number pair; range deliberately NOT enforced (an off-by-a-hair
  foot must never reject a FALL alert - renderers clamp).
- MIGRATION FIX: chk_events_type would have REJECTED the previous commit's
  lone_worker/overcapacity/overstay inserts on MySQL 8.0.16+ - the constraint
  is rebuilt with all 13 types (incl. near_fall).
- GET /api/heatmap/{camera}?days=N (1..90, default 30, 5000-point cap):
  spatial points with the same fail-closed site scoping as the event list.

UI (zone editor): "위험 히트맵" toggle + day window. Additive radial blots in
an offscreen layer under the zone polygons; severity weighs the alpha so a
cluster of near-misses reads lighter than one confirmed fall at the same spot.
Events console/detail label near_fall in Korean.

Verified: pytest 222 pass / PHPUnit 130 pass + Chrome real-render (blue
near-miss cluster + red incident hotspot inside the restricted zone, amber
cluster in the warning zone, zones drawn on top; no console errors).
2026-08-06 20:19:09 +09:00
..
adapters fix(edge): confidence-gate foot/nose keypoints, warn on MoveNet single-person (P2-9/10/11) 2026-07-17 10:25:04 +09:00
detectors feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay 2026-08-06 20:19:09 +09:00
tools feat(delivery-audit): privacy — face-blur sizing + model integrity (P3-1, P3-3) 2026-07-17 09:35:02 +09:00
__init__.py feat(edge): data models (Keypoint, BBox, Person) + COCO indices 2026-07-11 20:13:00 +09:00
__main__.py feat(edge): runnable daemon loop (step + periodic sync/heartbeat/flush) 2026-07-12 11:00:08 +09:00
alert.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
app.py fix(edge): close audit P2-6/7/8 - id swaps, one-frame FALLING, stale-track timers 2026-08-06 17:01:24 +09:00
config.py refactor: rename cloud/ to server/ (cafe24 is web hosting, not cloud) 2026-07-20 11:30:52 +09:00
daemon.py fix(edge): stop hiding a failed camera; fix ghost dedup leak + silent zone drop 2026-07-25 23:18:19 +09:00
engine.py feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay 2026-08-06 20:19:09 +09:00
events.py feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay 2026-08-06 20:19:09 +09:00
geometry.py fix(delivery): resolve codex + workflow review findings across edge/cloud/deploy 2026-07-17 19:24:42 +09:00
health.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
models.py feat(edge): data models (Keypoint, BBox, Person) + COCO indices 2026-07-11 20:13:00 +09:00
ports.py feat(edge): Track model + IoU tracker with lost-track reporting 2026-07-11 20:28:45 +09:00
probe.py feat(deploy): probe every camera before enabling the service 2026-07-20 23:22:20 +09:00
queue.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
runtime.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
serverclient.py refactor: rename cloud/ to server/ (cafe24 is web hosting, not cloud) 2026-07-20 11:30:52 +09:00
smoothing.py fix(edge): smooth keypoints per-track after tracking, not before (FIX 1) 2026-07-11 22:14:03 +09:00
snapshot.py feat(edge): RingBuffer + face blur + JPEG snapshotter 2026-07-11 21:21:57 +09:00
tracking.py fix(edge): close audit P2-6/7/8 - id swaps, one-frame FALLING, stale-track timers 2026-08-06 17:01:24 +09:00
zones.py feat(zones): occupancy rule engine - lone-worker / capacity / dwell limits 2026-08-06 19:33:12 +09:00