REPOSITORY
cnu/worker-gesture-perception Private
[참조 MVP] 작업자·제스처 인지 — 작업자 추적과 정지·호출 제스처를 구조화하는 참조 MVP입니다.
https://git.agrithing.ai/cnu/worker-gesture-perception.git dde583d feat: 작업자·제스처 인지 구체 MVP 구현
91ffdb9 ci: add static dynamic and evidence gates
789af9d feat: add executable institution reference MVP
aea3bf9 docs: define product role and interface contract
2 items · feat/concrete-mvp-v2
·/ asw_component/component.py
python · 1.1 KB · b2e6acb Download
from __future__ import annotationsCOMMANDS = {"STOP": "SAFETY_STOP", "FOLLOW": "FOLLOW_WORKER", "CALL": "APPROACH_WORKER"}def execute(payload: dict) -> dict: threshold = float(payload.get("confidenceThreshold", 0.8)) candidates = [track for track in payload.get("tracks", []) if float(track.get("confidence", 0)) >= threshold] candidates.sort(key=lambda track: (-float(track["confidence"]), track["id"])) selected = candidates[0] if candidates else None command = "WAIT" if not selected else COMMANDS.get(selected.get("gesture"), "WAIT") worker = None if not selected else {"id": selected["id"], "confidence": float(selected["confidence"]), "distanceM": float(selected.get("distanceM", 0)), "gesture": selected.get("gesture", "UNKNOWN")} return {"component": "cnu/worker-gesture-perception", "accepted": selected is not None, "status": "WORKER_READY" if selected else "NO_WORKER", "target": "vpu", "selectedWorker": worker, "command": command, "stopRequired": command == "SAFETY_STOP", "consideredTracks": len(payload.get("tracks", []))}