24 lines
681 B
Python
24 lines
681 B
Python
from __future__ import annotations
|
|
|
|
import importlib.util
|
|
from pathlib import Path
|
|
from types import ModuleType
|
|
|
|
|
|
def load_backend_script() -> ModuleType:
|
|
script = Path(__file__).resolve().parents[1] / "backend" / "scripts" / "yolo_preflight.py"
|
|
spec = importlib.util.spec_from_file_location("backend_yolo_preflight", script)
|
|
if spec is None or spec.loader is None:
|
|
raise RuntimeError(f"Could not load YOLO preflight implementation from {script}")
|
|
module = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(module)
|
|
return module
|
|
|
|
|
|
_impl = load_backend_script()
|
|
main = _impl.main
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|