handle various scenarios with external process failures

This commit is contained in:
Blake Blackshear
2020-03-09 21:12:19 -05:00
parent a60b9211d2
commit 3a9781c4f8
6 changed files with 218 additions and 133 deletions

View File

@@ -7,7 +7,7 @@ import SharedArray as sa
import pyarrow.plasma as plasma
import tflite_runtime.interpreter as tflite
from tflite_runtime.interpreter import load_delegate
from frigate.util import EventsPerSecond
from frigate.util import EventsPerSecond, listen
def load_labels(path, encoding='utf-8'):
"""Loads labels from file (with or without index numbers).
@@ -64,6 +64,7 @@ class ObjectDetector():
def run_detector(detection_queue, avg_speed, start):
print(f"Starting detection process: {os.getpid()}")
listen()
plasma_client = plasma.connect("/tmp/plasma")
object_detector = ObjectDetector()
@@ -87,7 +88,7 @@ def run_detector(detection_queue, avg_speed, start):
class EdgeTPUProcess():
def __init__(self):
self.detection_queue = mp.Queue()
self.detection_queue = mp.SimpleQueue()
self.avg_inference_speed = mp.Value('d', 0.01)
self.detection_start = mp.Value('d', 0.0)
self.detect_process = None