NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Properly call super() in subclasses (#14124)
gtsiam54900ae3180c
diff --git a/frigate/comms/zmq_proxy.py b/frigate/comms/zmq_proxy.pyindex bbe6601603..1661cfcc5b 100644--- a/frigate/comms/zmq_proxy.py+++ b/frigate/comms/zmq_proxy.py@@ -12,8 +12,7 @@ SOCKET_SUB = "ipc:///tmp/cache/proxy_sub"class ZmqProxyRunner(threading.Thread):def __init__(self, context: zmq.Context[zmq.Socket]) -> None:- threading.Thread.__init__(self)- self.name = "detection_proxy"+ super().__init__(name="detection_proxy")self.context = contextdef run(self) -> None:diff --git a/frigate/detectors/plugins/tensorrt.py b/frigate/detectors/plugins/tensorrt.pyindex bb3c737ad0..37936e191a 100644--- a/frigate/detectors/plugins/tensorrt.py+++ b/frigate/detectors/plugins/tensorrt.py@@ -26,9 +26,6 @@ DETECTOR_KEY = "tensorrt"if TRT_SUPPORT:class TrtLogger(trt.ILogger):- def __init__(self):- trt.ILogger.__init__(self)-def log(self, severity, msg):logger.log(self.getSeverity(severity), msg)diff --git a/frigate/events/cleanup.py b/frigate/events/cleanup.pyindex 35edf41959..7404495262 100644--- a/frigate/events/cleanup.py+++ b/frigate/events/cleanup.py@@ -23,8 +23,7 @@ class EventCleanupType(str, Enum):class EventCleanup(threading.Thread):def __init__(self, config: FrigateConfig, stop_event: MpEvent):- threading.Thread.__init__(self)- self.name = "event_cleanup"+ super().__init__(name="event_cleanup")self.config = configself.stop_event = stop_eventself.camera_keys = list(self.config.cameras.keys())diff --git a/frigate/events/maintainer.py b/frigate/events/maintainer.pyindex 0113047f23..b17bd5d357 100644--- a/frigate/events/maintainer.py+++ b/frigate/events/maintainer.py@@ -54,8 +54,7 @@ class EventProcessor(threading.Thread):timeline_queue: Queue,stop_event: MpEvent,):- threading.Thread.__init__(self)- self.name = "event_processor"+ super().__init__(name="event_processor")self.config = configself.timeline_queue = timeline_queueself.events_in_process: Dict[str, Event] = {}diff --git a/frigate/log.py b/frigate/log.pyindex a657fbb7d7..079fc61076 100644--- a/frigate/log.py+++ b/frigate/log.py@@ -70,8 +70,7 @@ os.register_at_fork(after_in_child=reopen_std_streams)class LogPipe(threading.Thread):def __init__(self, log_name: str):"""Setup the object with a logger and start the thread"""- threading.Thread.__init__(self)- self.daemon = False+ super().__init__(daemon=False)self.logger = logging.getLogger(log_name)self.level = logging.ERRORself.deque: Deque[str] = deque(maxlen=100)diff --git a/frigate/object_processing.py b/frigate/object_processing.pyindex 55f494d554..15874ca4ec 100644--- a/frigate/object_processing.py+++ b/frigate/object_processing.py@@ -932,8 +932,7 @@ class TrackedObjectProcessor(threading.Thread):ptz_autotracker_thread,stop_event,):- threading.Thread.__init__(self)- self.name = "detected_frames_processor"+ super().__init__(name="detected_frames_processor")self.config = configself.dispatcher = dispatcherself.tracked_objects_queue = tracked_objects_queuediff --git a/frigate/output/birdseye.py b/frigate/output/birdseye.pyindex 00e7c7ad1b..c187c77eaf 100644--- a/frigate/output/birdseye.py+++ b/frigate/output/birdseye.py@@ -122,8 +122,7 @@ class FFMpegConverter(threading.Thread):quality: int,birdseye_rtsp: bool = False,):- threading.Thread.__init__(self)- self.name = "birdseye_output_converter"+ super().__init__(name="birdseye_output_converter")self.camera = "birdseye"self.input_queue = input_queueself.stop_event = stop_event@@ -235,7 +234,7 @@ class BroadcastThread(threading.Thread):websocket_server,stop_event: mp.Event,):- super(BroadcastThread, self).__init__()+ super().__init__()self.camera = cameraself.converter = converterself.websocket_server = websocket_serverdiff --git a/frigate/output/camera.py b/frigate/output/camera.pyindex 317d7902ef..2311ec659e 100644--- a/frigate/output/camera.py+++ b/frigate/output/camera.py@@ -24,8 +24,7 @@ class FFMpegConverter(threading.Thread):out_height: int,quality: int,):- threading.Thread.__init__(self)- self.name = f"{camera}_output_converter"+ super().__init__(name=f"{camera}_output_converter")self.camera = cameraself.input_queue = input_queueself.stop_event = stop_event@@ -102,7 +101,7 @@ class BroadcastThread(threading.Thread):websocket_server,stop_event: mp.Event,):- super(BroadcastThread, self).__init__()+ super().__init__()self.camera = cameraself.converter = converterself.websocket_server = websocket_serverdiff --git a/frigate/output/preview.py b/frigate/output/preview.pyindex 5b5dd4afa6..a8915f688a 100644--- a/frigate/output/preview.py+++ b/frigate/output/preview.py@@ -66,8 +66,7 @@ class FFMpegConverter(threading.Thread):frame_times: list[float],requestor: InterProcessRequestor,):- threading.Thread.__init__(self)- self.name = f"{config.name}_preview_converter"+ super().__init__(name=f"{config.name}_preview_converter")self.config = configself.frame_times = frame_timesself.requestor = requestordiff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.pyindex d28166a7ba..fd9933bcb4 100644--- a/frigate/ptz/autotrack.py+++ b/frigate/ptz/autotrack.py@@ -149,8 +149,7 @@ class PtzAutoTrackerThread(threading.Thread):dispatcher: Dispatcher,stop_event: MpEvent,) -> None:- threading.Thread.__init__(self)- self.name = "ptz_autotracker"+ super().__init__(name="ptz_autotracker")self.ptz_autotracker = PtzAutoTracker(config, onvif, ptz_metrics, dispatcher, stop_event)diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.pyindex 615b6bdbdd..b70a23b45d 100644--- a/frigate/record/cleanup.py+++ b/frigate/record/cleanup.py@@ -23,8 +23,7 @@ class RecordingCleanup(threading.Thread):"""Cleanup existing recordings based on retention config."""def __init__(self, config: FrigateConfig, stop_event: MpEvent) -> None:- threading.Thread.__init__(self)- self.name = "recording_cleanup"+ super().__init__(name="recording_cleanup")self.config = configself.stop_event = stop_eventdiff --git a/frigate/record/export.py b/frigate/record/export.pyindex cbdb530144..395da79eaa 100644--- a/frigate/record/export.py+++ b/frigate/record/export.py@@ -57,7 +57,7 @@ class RecordingExporter(threading.Thread):end_time: int,playback_factor: PlaybackFactorEnum,) -> None:- threading.Thread.__init__(self)+ super().__init__()self.config = configself.export_id = idself.camera = cameradiff --git a/frigate/record/maintainer.py b/frigate/record/maintainer.pyindex bbc20d6124..f43d1424fa 100644--- a/frigate/record/maintainer.py+++ b/frigate/record/maintainer.py@@ -62,8 +62,7 @@ class SegmentInfo:class RecordingMaintainer(threading.Thread):def __init__(self, config: FrigateConfig, stop_event: MpEvent):- threading.Thread.__init__(self)- self.name = "recording_maintainer"+ super().__init__(name="recording_maintainer")self.config = config# create communication for retained recordingsdiff --git a/frigate/review/maintainer.py b/frigate/review/maintainer.pyindex b92fac99dc..3b5980a853 100644--- a/frigate/review/maintainer.py+++ b/frigate/review/maintainer.py@@ -146,8 +146,7 @@ class ReviewSegmentMaintainer(threading.Thread):"""Maintain review segments."""def __init__(self, config: FrigateConfig, stop_event: MpEvent):- threading.Thread.__init__(self)- self.name = "review_segment_maintainer"+ super().__init__(name="review_segment_maintainer")self.config = configself.active_review_segments: dict[str, Optional[PendingReviewSegment]] = {}self.frame_manager = SharedMemoryFrameManager()diff --git a/frigate/stats/emitter.py b/frigate/stats/emitter.pyindex 1683935e29..8a09ff51b9 100644--- a/frigate/stats/emitter.py+++ b/frigate/stats/emitter.py@@ -27,8 +27,7 @@ class StatsEmitter(threading.Thread):stats_tracking: StatsTrackingTypes,stop_event: MpEvent,):- threading.Thread.__init__(self)- self.name = "frigate_stats_emitter"+ super().__init__(name="frigate_stats_emitter")self.config = configself.stats_tracking = stats_trackingself.stop_event = stop_eventdiff --git a/frigate/storage.py b/frigate/storage.pyindex 029c5c3883..2dbd07a510 100644--- a/frigate/storage.py+++ b/frigate/storage.py@@ -22,8 +22,7 @@ class StorageMaintainer(threading.Thread):"""Maintain frigates recording storage."""def __init__(self, config: FrigateConfig, stop_event) -> None:- threading.Thread.__init__(self)- self.name = "storage_maintainer"+ super().__init__(name="storage_maintainer")self.config = configself.stop_event = stop_eventself.camera_storage_stats: dict[str, dict] = {}diff --git a/frigate/timeline.py b/frigate/timeline.pyindex 4a7ad73296..8055ccddcb 100644--- a/frigate/timeline.py+++ b/frigate/timeline.py@@ -23,8 +23,7 @@ class TimelineProcessor(threading.Thread):queue: Queue,stop_event: MpEvent,) -> None:- threading.Thread.__init__(self)- self.name = "timeline_processor"+ super().__init__(name="timeline_processor")self.config = configself.queue = queueself.stop_event = stop_eventdiff --git a/frigate/watchdog.py b/frigate/watchdog.pyindex c6d55d18c8..d7cdec796d 100644--- a/frigate/watchdog.py+++ b/frigate/watchdog.py@@ -12,8 +12,7 @@ logger = logging.getLogger(__name__)class FrigateWatchdog(threading.Thread):def __init__(self, detectors: dict[str, ObjectDetectProcess], stop_event: MpEvent):- threading.Thread.__init__(self)- self.name = "frigate_watchdog"+ super().__init__(name="frigate_watchdog")self.detectors = detectorsself.stop_event = stop_event