mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-01 20:56:44 -05:00
Compare commits
3 Commits
v0.17.0-rc
...
fix-genai
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9448af3f83 | ||
|
|
6139e18df7 | ||
|
|
3101d5f27b |
@@ -186,7 +186,7 @@ There are improved capabilities in newer GPU architectures that TensorRT can ben
|
||||
|
||||
#### Compatibility References:
|
||||
|
||||
[NVIDIA TensorRT Support Matrix](https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-841/support-matrix/index.html)
|
||||
[NVIDIA TensorRT Support Matrix](https://docs.nvidia.com/deeplearning/tensorrt-rtx/latest/getting-started/support-matrix.html)
|
||||
|
||||
[NVIDIA CUDA Compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/index.html)
|
||||
|
||||
|
||||
@@ -103,16 +103,19 @@ class ObjectDescriptionProcessor(PostProcessorApi):
|
||||
logger.debug(f"{camera} sending early request to GenAI")
|
||||
|
||||
self.early_request_sent[data["id"]] = True
|
||||
# Copy thumbnails to avoid holding references after cleanup
|
||||
thumbnails_copy = [
|
||||
data["thumbnail"][:] if data.get("thumbnail") else None
|
||||
for data in self.tracked_events[data["id"]]
|
||||
if data.get("thumbnail")
|
||||
]
|
||||
threading.Thread(
|
||||
target=self._genai_embed_description,
|
||||
name=f"_genai_embed_description_{event.id}",
|
||||
daemon=True,
|
||||
args=(
|
||||
event,
|
||||
[
|
||||
data["thumbnail"]
|
||||
for data in self.tracked_events[data["id"]]
|
||||
],
|
||||
thumbnails_copy,
|
||||
),
|
||||
).start()
|
||||
|
||||
@@ -173,7 +176,10 @@ class ObjectDescriptionProcessor(PostProcessorApi):
|
||||
[snapshot_image]
|
||||
if event.has_snapshot and source == "snapshot"
|
||||
else (
|
||||
[data["thumbnail"] for data in self.tracked_events[event_id]]
|
||||
# Copy thumbnails to avoid holding references
|
||||
[data["thumbnail"][:] if data.get("thumbnail") else None
|
||||
for data in self.tracked_events[event_id]
|
||||
if data.get("thumbnail")]
|
||||
if len(self.tracked_events.get(event_id, [])) > 0
|
||||
else [thumbnail]
|
||||
)
|
||||
@@ -277,7 +283,10 @@ class ObjectDescriptionProcessor(PostProcessorApi):
|
||||
[snapshot_image]
|
||||
if event.has_snapshot and camera_config.objects.genai.use_snapshot
|
||||
else (
|
||||
[data["thumbnail"] for data in self.tracked_events[event.id]]
|
||||
# Copy thumbnails to avoid holding references after cleanup
|
||||
[data["thumbnail"][:] if data.get("thumbnail") else None
|
||||
for data in self.tracked_events[event.id]
|
||||
if data.get("thumbnail")]
|
||||
if num_thumbnails > 0
|
||||
else [thumbnail]
|
||||
)
|
||||
|
||||
@@ -679,4 +679,7 @@ class EmbeddingMaintainer(threading.Thread):
|
||||
if not self.config.semantic_search.enabled:
|
||||
return
|
||||
|
||||
self.embeddings.embed_thumbnail(event_id, thumbnail)
|
||||
try:
|
||||
self.embeddings.embed_thumbnail(event_id, thumbnail)
|
||||
except ValueError:
|
||||
logger.warning(f"Failed to embed thumbnail for event {event_id}")
|
||||
|
||||
Reference in New Issue
Block a user