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

jbnu/environment-adaptive-perception Private

[참조 MVP] 환경 적응형 인지 A-SW — 조도·강우·먼지 조건에 따라 탐지 임계값과 센서 우선순위를 조정합니다.

https://git.agrithing.ai/jbnu/environment-adaptive-perception.git
7 commits
COMMIT DETAIL

feat: add executable reference MVP

A-SW Reference Factory <[email protected]> · 2026. 8. 2. 오전 7:38:03
f4e589c5fd528193c4e47cb4e8713dd0849a27b7
5 changed files +38 −0 parent be6d31d
added asw_component/__init__.py +3−0 View file
@@ -0,0 +1,3 @@
1 + from .component import execute
2 +
3 + __all__ = ["execute"]
added asw_component/component.py +11−0 View file
@@ -0,0 +1,11 @@
1 + from __future__ import annotations
2 +
3 + def execute(payload: dict) -> dict:
4 + lux = max(0.0, float(payload.get("brightness_lux", 500)))
5 + rain = min(1.0, max(0.0, float(payload.get("rain_level", 0))))
6 + dust = min(1.0, max(0.0, float(payload.get("dust_level", 0))))
7 + threshold = float(payload.get("base_threshold", 0.5))
8 + threshold += 0.08 if lux < 50 else (-0.03 if lux > 1000 else 0)
9 + threshold += 0.1 * rain + 0.08 * dust
10 + primary = "radar" if rain > 0.6 or dust > 0.6 else ("thermal_camera" if lux < 30 else "rgb_camera")
11 + return {"detection_threshold": round(min(0.95, threshold), 3), "primary_sensor": primary, "degradation": round(max(rain, dust, max(0, (50-lux)/50)), 3)}
added examples/input.json +6−0 View file
@@ -0,0 +1,6 @@
1 + {
2 + "brightness_lux": 120,
3 + "rain_level": 0.2,
4 + "dust_level": 0.1,
5 + "base_threshold": 0.55
6 + }
added pyproject.toml +8−0 View file
@@ -0,0 +1,8 @@
1 + [project]
2 + name = "environment_adaptive_perception"
3 + version = "0.1.0"
4 + description = "조도·강우·먼지 조건에 따라 탐지 임계값과 센서 우선순위를 조정합니다."
5 + requires-python = ">=3.11"
6 +
7 + [tool.unittest]
8 + test-path = "tests"
added run.py +10−0 View file
@@ -0,0 +1,10 @@
1 + from __future__ import annotations
2 + import json
3 + import sys
4 + from asw_component import execute
5 +
6 + if __name__ == "__main__":
7 + path = sys.argv[1] if len(sys.argv) > 1 else None
8 + with open(path, encoding="utf-8") if path else sys.stdin as source:
9 + payload = json.load(source)
10 + print(json.dumps(execute(payload), ensure_ascii=False, indent=2))