mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
* Include config publisher in api * Call update topic for passed topics * Update zones dynamically * Update zones internally * Support zone and mask reset * Handle updating objects config * Don't put status for needing to restart Frigate * Cleanup http tests * Fix tests
41 lines
868 B
Python
41 lines
868 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Tuple
|
|
|
|
from numpy import ndarray
|
|
|
|
from frigate.config import MotionConfig
|
|
|
|
|
|
class MotionDetector(ABC):
|
|
@abstractmethod
|
|
def __init__(
|
|
self,
|
|
frame_shape: Tuple[int, int, int],
|
|
config: MotionConfig,
|
|
fps: int,
|
|
improve_contrast,
|
|
threshold,
|
|
contour_area,
|
|
):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def detect(self, frame: ndarray) -> list:
|
|
"""Detect motion and return motion boxes."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def is_calibrating(self):
|
|
"""Return if motion is recalibrating."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def update_mask(self) -> None:
|
|
"""Update the motion mask after a config change."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def stop(self):
|
|
"""Stop any ongoing work and processes."""
|
|
pass
|