A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

cnu/worker-gesture-perception Private

[참조 MVP] 작업자·제스처 인지 — 작업자 추적과 정지·호출 제스처를 구조화하는 참조 MVP입니다.

https://git.agrithing.ai/cnu/worker-gesture-perception.git
4 commits
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", []))}