From ee53eb3cd520dd6614c11ad638b0d4838d323238 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Fri, 30 May 2025 09:47:11 +0200 Subject: [PATCH] DAQ: Path to ML model is relative (to be fixed, as this won't work with pip anyway!) --- daq/src/aaredaq/mlbox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daq/src/aaredaq/mlbox.py b/daq/src/aaredaq/mlbox.py index a850af50..c94911fa 100644 --- a/daq/src/aaredaq/mlbox.py +++ b/daq/src/aaredaq/mlbox.py @@ -1,9 +1,12 @@ +from pathlib import Path from typing import Tuple from ultralytics import YOLO + class MlBox: - def __init__(self, model_path: str = "/home/leonarski_f/mxlibs3/src/aaredaq/best.pt"): + def __init__(self, model_path: str = "best.pt"): + model_path = str(Path(__file__).parent / model_path) self.__model = YOLO(model_path) @staticmethod