From 7d33e03943555e7bec6562539b55aff6b58df66b Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 25 Apr 2020 07:40:12 -0500 Subject: [PATCH] ensure detection_start doesnt change values between conditions --- detect_objects.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/detect_objects.py b/detect_objects.py index f719177fe..91e0e07ea 100644 --- a/detect_objects.py +++ b/detect_objects.py @@ -92,8 +92,9 @@ class CameraWatchdog(threading.Thread): self.plasma_process = start_plasma_store() # check the detection process - if (self.tflite_process.detection_start.value > 0.0 and - datetime.datetime.now().timestamp() - self.tflite_process.detection_start.value > 10): + detection_start = self.tflite_process.detection_start.value + if (detection_start > 0.0 and + datetime.datetime.now().timestamp() - detection_start > 10): print("Detection appears to be stuck. Restarting detection process") self.tflite_process.start_or_restart() elif not self.tflite_process.detect_process.is_alive():