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

unist/crop-structure-mapping Private

[참조 MVP] 작물구조 3D 매핑 — 작물과 장애물 관측을 작업공간 지도로 집계하는 위탁연구 참조 MVP입니다.

https://git.agrithing.ai/unist/crop-structure-mapping.git
4 commits
2 items · feat/concrete-mvp-v2
·/ asw_component/component.py
python · 1.0 KB · 3a7531a Download
from __future__ import annotationsdef execute(payload: dict) -> dict:    valid = []    for point in payload.get("points", []):        try:            valid.append({"class": str(point["class"]), "x": float(point["x"]), "y": float(point["y"]), "z": float(point["z"])})        except (KeyError, TypeError, ValueError):            continue    counts = {}    for point in valid: counts[point["class"]] = counts.get(point["class"], 0) + 1    bounds = None if not valid else {axis: [min(point[axis] for point in valid), max(point[axis] for point in valid)] for axis in ("x", "y", "z")}    obstacles = [{"x": point["x"], "y": point["y"], "z": point["z"]} for point in valid if point["class"] == "obstacle"]    accepted = bool(valid)    return {"component": "unist/crop-structure-mapping", "accepted": accepted,            "status": "MAP_READY" if accepted else "NO_POINTS", "target": "vpu",            "mapId": str(payload.get("mapId", "unknown")), "counts": counts,            "bounds": bounds, "obstacles": obstacles}