asw_component/__init__.py +3−0 View file@@ -0,0 +1,3 @@
1 +
from .component import execute 2 +
3 +
__all__ = ["execute"][참조 MVP] 환경 적응형 인지 A-SW — 조도·강우·먼지 조건에 따라 탐지 임계값과 센서 우선순위를 조정합니다.
https://git.agrithing.ai/jbnu/environment-adaptive-perception.git f7fec31 5816174 ae4151f 2ed89a8 a8a443e f4e589c be6d31d f4e589c5fd528193c4e47cb4e8713dd0849a27b7 asw_component/__init__.py +3−0 View filefrom .component import execute__all__ = ["execute"]asw_component/component.py +11−0 View filefrom __future__ import annotationsdef execute(payload: dict) -> dict: lux = max(0.0, float(payload.get("brightness_lux", 500))) rain = min(1.0, max(0.0, float(payload.get("rain_level", 0)))) dust = min(1.0, max(0.0, float(payload.get("dust_level", 0)))) threshold = float(payload.get("base_threshold", 0.5)) threshold += 0.08 if lux < 50 else (-0.03 if lux > 1000 else 0) threshold += 0.1 * rain + 0.08 * dust primary = "radar" if rain > 0.6 or dust > 0.6 else ("thermal_camera" if lux < 30 else "rgb_camera") return {"detection_threshold": round(min(0.95, threshold), 3), "primary_sensor": primary, "degradation": round(max(rain, dust, max(0, (50-lux)/50)), 3)}examples/input.json +6−0 View file{ "brightness_lux": 120, "rain_level": 0.2, "dust_level": 0.1, "base_threshold": 0.55}pyproject.toml +8−0 View file[project]name = "environment_adaptive_perception"version = "0.1.0"description = "조도·강우·먼지 조건에 따라 탐지 임계값과 센서 우선순위를 조정합니다."requires-python = ">=3.11"[tool.unittest]test-path = "tests"run.py +10−0 View filefrom __future__ import annotationsimport jsonimport sysfrom asw_component import executeif __name__ == "__main__": path = sys.argv[1] if len(sys.argv) > 1 else None with open(path, encoding="utf-8") if path else sys.stdin as source: payload = json.load(source) print(json.dumps(execute(payload), ensure_ascii=False, indent=2))