Fix model errors (#17171)

This commit is contained in:
Nicolas Mowen 2025-03-16 05:01:15 -06:00 committed by GitHub
parent d87268acfe
commit db541abed4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 8 deletions

View File

@ -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 = (

View File

@ -144,7 +144,8 @@ class BirdRealTimeProcessor(RealTimeProcessorApi):
return
self.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"]] = score

View File

@ -1,4 +1,5 @@
import logging
import os
import numpy as np
from 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."
)
raise
self.interpreter.allocate_tensors()

View File

@ -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,

View File

@ -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 metadata
title = 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}"])