NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Fix model errors (#17171)
Nicolas Mowendb541abed4c5
diff --git a/frigate/config/config.py b/frigate/config/config.pyindex 633aef8030..ce59e6733f 100644--- a/frigate/config/config.py+++ b/frigate/config/config.py@@ -608,6 +608,11 @@ class FrigateConfig(FrigateBaseModel):self.model.create_colormap(sorted(self.objects.all_objects))self.model.check_and_load_plus_model(self.plus_api)+ if self.plus_api and not self.snapshots.clean_copy:+ logger.warning(+ "Frigate+ is configured but clean snapshots are not enabled, submissions to Frigate+ will not be possible./"+ )+for key, detector in self.detectors.items():adapter = TypeAdapter(DetectorConfig)model_dict = (diff --git a/frigate/data_processing/real_time/bird.py b/frigate/data_processing/real_time/bird.pyindex ba6d4f08c0..ea181d6c35 100644--- a/frigate/data_processing/real_time/bird.py+++ b/frigate/data_processing/real_time/bird.py@@ -144,7 +144,8 @@ class BirdRealTimeProcessor(RealTimeProcessorApi):returnself.sub_label_publisher.publish(- EventMetadataTypeEnum.sub_label, (id, self.labelmap[best_id], score)+ EventMetadataTypeEnum.sub_label,+ (obj_data["id"], self.labelmap[best_id], score),)self.detected_birds[obj_data["id"]] = scorediff --git a/frigate/detectors/plugins/edgetpu_tfl.py b/frigate/detectors/plugins/edgetpu_tfl.pyindex c320bd89bc..246d2dd41e 100644--- a/frigate/detectors/plugins/edgetpu_tfl.py+++ b/frigate/detectors/plugins/edgetpu_tfl.py@@ -1,4 +1,5 @@import logging+import osimport numpy as npfrom pydantic import Field@@ -45,9 +46,17 @@ class EdgeTpuTfl(DetectionApi):experimental_delegates=[edge_tpu_delegate],)except ValueError:- logger.error(- "No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors."- )+ _, ext = os.path.splitext(detector_config.model.path)++ if ext and ext != ".tflite":+ logger.error(+ "Incorrect model used with EdgeTPU. Only .tflite models can be used with a Coral EdgeTPU."+ )+ else:+ logger.error(+ "No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors."+ )+raiseself.interpreter.allocate_tensors()diff --git a/frigate/embeddings/__init__.py b/frigate/embeddings/__init__.pyindex 56bd097d66..0a0d7200a5 100644--- a/frigate/embeddings/__init__.py+++ b/frigate/embeddings/__init__.py@@ -225,6 +225,9 @@ class EmbeddingsContext:if os.path.isfile(file_path):os.unlink(file_path)+ if len(os.listdir(folder)) == 0:+ os.rmdir(folder)+def update_description(self, event_id: str, description: str) -> None:self.requestor.send_data(EmbeddingsRequestEnum.embed_description.value,diff --git a/frigate/record/export.py b/frigate/record/export.pyindex 0e64021b4c..4eadbf1bd7 100644--- a/frigate/record/export.py+++ b/frigate/record/export.py@@ -19,7 +19,6 @@ from frigate.const import (CACHE_DIR,CLIPS_DIR,EXPORT_DIR,- FFMPEG_HVC1_ARGS,MAX_PLAYLIST_SECONDS,PREVIEW_FRAME_TYPE,)@@ -233,9 +232,6 @@ class RecordingExporter(threading.Thread):)).split(" ")- if self.config.ffmpeg.apple_compatibility:- ffmpeg_cmd += FFMPEG_HVC1_ARGS-# add metadatatitle = f"Frigate Recording for {self.camera}, {self.get_datetime_from_timestamp(self.start_time)} - {self.get_datetime_from_timestamp(self.end_time)}"ffmpeg_cmd.extend(["-metadata", f"title={title}"])