update power estimation and upload 2 models of yolo
This commit is contained in:
21
main.py
21
main.py
@@ -30,6 +30,7 @@ from ota_manager import ota_manager
|
||||
from hardware import hardware_manager
|
||||
from camera_manager import camera_manager
|
||||
from shoot_manager import process_shot, preload_triangle_calib
|
||||
from target_roi_yolo import preload_yolo_detector
|
||||
|
||||
|
||||
def laser_calibration_worker():
|
||||
@@ -148,6 +149,26 @@ def cmd_str():
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 2.7 预加载 YOLO(靶环 ROI + 黑三角);dual_buff=False 时无需 warmup 消除一帧延迟
|
||||
try:
|
||||
_preload_yolo = bool(getattr(config, "TRIANGLE_YOLO_PRELOAD_ON_BOOT", True))
|
||||
_loc_black = str(
|
||||
getattr(config, "TRIANGLE_BLACK_TRIANGLE_LOCATE_MODE", "yolo")
|
||||
).lower().strip()
|
||||
if _loc_black not in ("yolo", "traditional"):
|
||||
_loc_black = "yolo"
|
||||
_need_black_preload = (
|
||||
bool(getattr(config, "TRIANGLE_BLACK_YOLO_ENABLE", False))
|
||||
and _loc_black == "yolo"
|
||||
and bool(getattr(config, "TRIANGLE_BLACK_YOLO_PRELOAD_ON_BOOT", True))
|
||||
)
|
||||
_preload_yolo = _preload_yolo or _need_black_preload
|
||||
if _preload_yolo:
|
||||
preload_yolo_detector(logger)
|
||||
except Exception as e:
|
||||
if logger:
|
||||
logger.warning(f"[YOLO-ROI] 启动预加载异常(不影响后续射箭): {e}")
|
||||
|
||||
# 3. 启动时检查:是否需要恢复备份
|
||||
pending_path = f"{config.APP_DIR}/ota_pending.json"
|
||||
if os.path.exists(pending_path):
|
||||
|
||||
Reference in New Issue
Block a user