diff --git a/frigate/util.py b/frigate/util.py index 0ae2848e9..b837edcf5 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -17,6 +17,7 @@ from typing import AnyStr import cv2 import matplotlib.pyplot as plt import numpy as np +import psutil logger = logging.getLogger(__name__) @@ -518,6 +519,13 @@ def clipped(obj, frame_shape): return False +def restart_frigate(): + for proc in psutil.process_iter(): + if proc.name().startswith("frigate.detector."): + psutil.Process(proc.pid).terminate() + return + + class EventsPerSecond: def __init__(self, max_events=1000): self._start = None