call the restart function and handle errors better in the detection process

This commit is contained in:
Blake Blackshear
2020-03-01 18:42:52 -06:00
parent 2768e1dadb
commit c80137e059
2 changed files with 8 additions and 4 deletions

View File

@@ -76,6 +76,7 @@ class CameraWatchdog(threading.Thread):
if (self.tflite_process.detection_start.value > 0.0 and
datetime.datetime.now().timestamp() - self.tflite_process.detection_start.value > 10):
print("Detection appears to be stuck. Restarting detection process")
self.tflite_process.start_or_restart()
time.sleep(30)
for name, camera_process in self.camera_processes.items():