From 60494c38b1958d4fd9aae24745189f06b689f704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E7=8E=AE?= Date: Fri, 22 Nov 2024 16:02:56 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81image=20framework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/image_framework.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/image_framework.py b/components/image_framework.py index 81f8a07..9b1708c 100644 --- a/components/image_framework.py +++ b/components/image_framework.py @@ -200,11 +200,6 @@ class ImageFramework(EdgeComponent): def configure(self, setting: Settings) -> None: self.init_image_framework_sdk() - self.location_thread = threading.Thread(target=self._location_processing_thread) - self.location_thread.daemon = True - self.process_thread = threading.Thread(target=self._main_processing_thread) - self.process_thread.daemon = True - self.logger.info(f"Image framework configure done.") def init_image_framework_sdk(self): @@ -281,6 +276,10 @@ class ImageFramework(EdgeComponent): @service() def start_location(self): self.thread_running = True + self.location_thread = threading.Thread(target=self._location_processing_thread) + self.location_thread.daemon = True + self.process_thread = threading.Thread(target=self._main_processing_thread) + self.process_thread.daemon = True self.location_thread.start() self.process_thread.start() @@ -289,8 +288,10 @@ class ImageFramework(EdgeComponent): self.thread_running = False if self.location_thread is not None: self.location_thread.join() + self.location_thread = None if self.process_thread is not None: self.process_thread.join() + self.process_thread = None @service() def start_detect(self):