Coverage for orchestr_ant_ion / yolo / __init__.py: 0%

25 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-19 08:36 +0000

1from __future__ import annotations 

2 

3import importlib 

4from typing import TYPE_CHECKING, Optional 

5 

6from orchestr_ant_ion.monitoring.gpu import PYNVML_AVAILABLE 

7from orchestr_ant_ion.pipeline.capture import CameraCapture, OpenCVCapture 

8from orchestr_ant_ion.pipeline.capture.gstreamer import ( 

9 GStreamerSubprocessCapture, 

10 find_gstreamer_launch, 

11 get_gstreamer_env, 

12) 

13from orchestr_ant_ion.pipeline.logging import configure_logging 

14from orchestr_ant_ion.pipeline.metrics.performance import PerformanceTracker 

15from orchestr_ant_ion.pipeline.monitoring.system import ( 

16 SystemMonitor, 

17) 

18from orchestr_ant_ion.pipeline.tracking.centroid import SimpleCentroidTracker 

19from orchestr_ant_ion.pipeline.types import ( 

20 CameraConfig, 

21 CaptureBackend, 

22 PerformanceMetrics, 

23 SystemStats, 

24 Track, 

25) 

26from orchestr_ant_ion.pipeline.ui.dearpygui import DearPyGuiViewer 

27from orchestr_ant_ion.yolo.cli import parse_args 

28from orchestr_ant_ion.yolo.core.constants import CLASS_NAMES, COLORS 

29from orchestr_ant_ion.yolo.core.postprocess import postprocess 

30from orchestr_ant_ion.yolo.core.preprocess import infer_input_size, preprocess 

31from orchestr_ant_ion.yolo.ui.draw import ( 

32 draw_2d_running_map, 

33 draw_cpu_process_history_plot, 

34 draw_detections, 

35 get_color_by_percent, 

36) 

37 

38 

39if TYPE_CHECKING: 

40 from orchestr_ant_ion.pipeline.ui.wx import ( 

41 WxPythonViewer as WxPythonViewerType, 

42 ) 

43 

44WxPythonViewer: type[WxPythonViewerType] | None = None 

45try: 

46 _wx_mod = importlib.import_module("orchestr_ant_ion.pipeline.ui.wx") 

47 WxPythonViewer = getattr(_wx_mod, "WxPythonViewer", None) 

48except Exception: # pragma: no cover - optional dependency 

49 WxPythonViewer = None 

50 

51 

52def run_yolo_monitor(argv: list[str] | None = None) -> int: 

53 """Run the YOLO monitor entry point via lazy import.""" 

54 module = importlib.import_module("orchestr_ant_ion.yolo.monitor") 

55 return module.run_yolo_monitor(argv) 

56 

57 

58__all__ = [ 

59 "CLASS_NAMES", 

60 "COLORS", 

61 "PYNVML_AVAILABLE", 

62 "CameraCapture", 

63 "CameraConfig", 

64 "CaptureBackend", 

65 "DearPyGuiViewer", 

66 "GStreamerSubprocessCapture", 

67 "OpenCVCapture", 

68 "PerformanceMetrics", 

69 "PerformanceTracker", 

70 "SimpleCentroidTracker", 

71 "SystemMonitor", 

72 "SystemStats", 

73 "Track", 

74 "WxPythonViewer", 

75 "configure_logging", 

76 "draw_2d_running_map", 

77 "draw_cpu_process_history_plot", 

78 "draw_detections", 

79 "find_gstreamer_launch", 

80 "get_color_by_percent", 

81 "get_gstreamer_env", 

82 "infer_input_size", 

83 "parse_args", 

84 "postprocess", 

85 "preprocess", 

86 "run_yolo_monitor", 

87]