From 9a647518550bb5814bd6126221291102dd28f4e7 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 30 Apr 2024 11:46:01 +0200 Subject: [PATCH] Fix multiprocessing Event typing in renderer --- trap/renderer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trap/renderer.py b/trap/renderer.py index 453de58..e2c531f 100644 --- a/trap/renderer.py +++ b/trap/renderer.py @@ -4,6 +4,7 @@ from argparse import Namespace import datetime import logging from multiprocessing import Event +from multiprocessing.synchronize import Event as BaseEvent import cv2 import numpy as np @@ -15,7 +16,7 @@ from trap.frame_emitter import DetectionState, Frame logger = logging.getLogger("trap.renderer") class Renderer: - def __init__(self, config: Namespace, is_running: Event): + def __init__(self, config: Namespace, is_running: BaseEvent): self.config = config self.is_running = is_running @@ -237,6 +238,6 @@ def decorate_frame(frame: Frame, prediction_frame: Frame, first_time: float, con return img -def run_renderer(config: Namespace, is_running: Event): +def run_renderer(config: Namespace, is_running: BaseEvent): renderer = Renderer(config, is_running) renderer.run() \ No newline at end of file