feat: Enhance inference management with device tracking and telemetry updates
This commit is contained in:
@@ -184,6 +184,7 @@ class MainWindow(QMainWindow):
|
||||
# ---- InferenceManager ----
|
||||
self._inference.detections_ready.connect(self._bbox_overlay.on_detections)
|
||||
self._inference.detection_count_updated.connect(self._on_detection_count_updated)
|
||||
self._inference.inference_stats_updated.connect(self._on_inference_stats_updated)
|
||||
self._inference.inference_started.connect(self._on_inference_started)
|
||||
self._inference.inference_stopped.connect(self._on_inference_stopped)
|
||||
self._inference.inference_error.connect(self._on_inference_error)
|
||||
@@ -267,6 +268,9 @@ class MainWindow(QMainWindow):
|
||||
def _on_detection_count_updated(self, count: int) -> None:
|
||||
self._detection_label.setText(f"Detections: {count} frames")
|
||||
|
||||
def _on_inference_stats_updated(self, device: str, avg_ms: float) -> None:
|
||||
self._telemetry.set_inference_stats(device, avg_ms)
|
||||
|
||||
def _on_inference_stopped(self) -> None:
|
||||
self._bbox_overlay.clear()
|
||||
|
||||
@@ -276,6 +280,7 @@ class MainWindow(QMainWindow):
|
||||
self._menu.set_inference_checked(False)
|
||||
self._bbox_overlay.visible = False
|
||||
self._detection_label.setVisible(False)
|
||||
self._telemetry.clear_inference_stats()
|
||||
QMessageBox.critical(self, "Inference Error", message)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
@@ -350,6 +355,7 @@ class MainWindow(QMainWindow):
|
||||
self._bbox_overlay.clear()
|
||||
self._bbox_overlay.visible = False
|
||||
self._detection_label.setVisible(False)
|
||||
self._telemetry.clear_inference_stats()
|
||||
self._status_label.setText("Inference disabled")
|
||||
logger.info("Inference disabled")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user