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):