The feedback loop, per product decision (option a): tags feed STATISTICS only.
A human reads the rate and re-tunes a camera deliberately - the tag never
adjusts edge sensitivity on its own (no silent behavior change in a safety
system).
- POST /events/{id}/false-positive: same RBAC ('acknowledge') + CSRF + site
scope as ack. Tagging also acknowledges (an FP is a handled event - leaving
it unacknowledged would keep it alarming). COALESCE keeps the FIRST tagger:
a second tag never rewrites who made the original audit-relevant call.
- move_events.false_positive_by/at (migration included), audit-logged.
- GET /api/fp-stats?days=N: per-(camera, event_type) totals + FP counts,
FP>0 groups only, fp-desc, fail-closed site scoping.
- Console: each open row gets a visually-secondary 오탐 button beside 확인
(can't be fat-fingered as the default); resolved rows show a mono verdict
("오탐 (user)" struck through vs "확인됨 (user)"). New rail panel "오탐율 ·
30일" lists top offenders - 30%+ highlighted as re-tuning candidates -
refreshed on a slow 60s cadence plus immediately after a tag. Detail view
shows the tag.
Verified: PHPUnit 135 pass / pytest unchanged + Chrome real-render (tag ->
row flips to struck-through verdict + drops out of unacked KPI/tree counts ->
FP panel updates immediately; no console errors).
3.7 KiB
3.7 KiB
PROJECT_MAP — move_detect
작업 전 이 문서로 위치를 찾고 필요한 파일만 연다 (전체 재스캔 금지). 새 파일·라우트·스키마 변경 시 해당 섹션을 갱신할 것.
개요
작업장 안전 AI CCTV. Raspberry Pi 5 + Hailo-8 엣지 추론(Python) → HMAC POST → Cafe24 웹호스팅 PHP+MySQL 대시보드. 감지: 넘어짐 · 넘어짐 후 미동 · 장시간 부동 · 위험구역 침입(경고/절대금지/협착) · 유령사고(위험 상태로 소실). 스냅샷만 전송, 라이브뷰·영상 없음.
edge/ (Python — Pi에서 구동)
| 파일 | 역할 |
|---|---|
app.py |
run_once 파이프라인 (프레임→추론→추적→감지→스냅샷→전송). ambiguous 리셋·stale 필터 |
engine.py |
EventEngine — 감지기 오케스트레이션, 쿨다운 dedup, 트랙 forget |
tracking.py |
IouTracker — 전역 그리디 IoU 매칭, ambiguous() (교차 경합 트랙) |
detectors/ |
fall.py(FALLING→FALLEN→NO_MOTION, sustained prone) · immobility.py · ghost.py · zone.py · occupancy.py(존 규칙: 2인1조/정원/체류상한 — Zone.rules 소비) |
smoothing.py |
트랙별 키포인트 스무딩 풀 |
snapshot.py |
RingBuffer · FaceBlurrer(PIPA) · Snapshotter |
alert.py / serverclient.py |
HMAC+nonce POST, 커스텀 UA, no-redirect |
queue.py |
오프라인 전송 큐 |
config.py |
env → Config (빈 CAFE24_URL/SECRET는 기동 실패) |
daemon.py / runtime.py / health.py |
상주 루프 · 하트비트 텔레메트리 |
adapters/ |
hailo_pose · movenet_pose(CPU 폴백) · picamera_source(CSI) · uvc_source(USB) |
probe.py / tools/ |
카메라 사전 점검 · HEF/모델 fetch (빌드머신 전용) |
server/ (PHP 8 + PDO — Cafe24)
- 진입:
public/index.php(라우트 전부 여기), 뷰:src/View/{layout,events,login,zones,event_detail}.php - 라우트:
POST /api/events(ingest, HMAC) ·POST /api/heartbeat·GET /api/config·GET /api/events·GET /api/devices·GET /api/heatmap/{camera}(spatial 집계) ·GET /api/fp-stats(오탐율) ·GET/POST /api/zones*·POST /login|/logout·GET /snap/{uuid}·POST /events/{id}/ack·POST /events/{id}/false-positive(오탐 태그, ack 겸함) · 페이지/,/login,/zones,/events/{id}/view src/Ingest/HMAC+nonce+rate-limit+replay 방지 ·src/Auth/argon2id/세션/RBAC/CSRF ·src/Dashboard/이벤트목록·디바이스상태·존편집·스냅샷프록시 ·src/Repository/9종 (인터페이스+PDO)- 프런트:
public/assets/app.js(이벤트 콘솔 폴링·필터) ·device-tree.js(장치→카메라 트리 레일) ·zone-draw.js·detail.js·app.css - DB:
schema.sql(테이블 prefixmove_), 마이그레이션migrations/. 존 행의rules_json(선택) = 점유 규칙 {min_workers,max_workers,max_dwell_s} — 편집기 저장 시 ZoneConfigController가 검증, /api/config로 엣지 전달 - 배포:
server/deploy/build_cafe24_package.sh→ zip,server/docs/server-deploy.md
deploy/ · dist/ (납품)
deploy/: Pi 설치 —setup_online.sh,bundle/build_offline_bundle.sh(폐쇄망),systemd/move-detect-edge.service,device.env(사전 프로비저닝)dist/:1_cafe24_upload/·2_pi_install/·PROVISION_SECRETS.md
tests/
- Python:
tests/31파일 (pytest) — 하드웨어 필요 테스트는tests/hardware/+ skip 마커 - PHP:
server/tests/19파일 (phpunit, in-memory repo; PDO 통합은 skip 게이트)
docs/
delivery-audit.md(감사 43건, 전부 완료 — OFF-HW 실장비 검증만 잔여) · pilot-runbook.md ·
hardware-bringup.md · INDEX.md(작업 기록)