From 8f77aa288ce66080272f820f3e900f74d2794219 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 7 Aug 2025 05:52:51 -0600 Subject: [PATCH] Prompt improvements and image saving --- frigate/data_processing/post/review_descriptions.py | 2 ++ frigate/data_processing/post/types.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frigate/data_processing/post/review_descriptions.py b/frigate/data_processing/post/review_descriptions.py index e20838860..a1825e372 100644 --- a/frigate/data_processing/post/review_descriptions.py +++ b/frigate/data_processing/post/review_descriptions.py @@ -1,6 +1,7 @@ """Post processor for review items to get descriptions.""" import logging +import shutil import cv2 @@ -47,6 +48,7 @@ class ReviewDescriptionProcessor(PostProcessorApi): # we have already processed this thumbnail return + shutil.copy(thumb_path, f"/media/frigate/frames/{thumb_time}.webp") thumb_data = cv2.imread(thumb_path) ret, jpg = cv2.imencode( ".jpg", thumb_data, [int(cv2.IMWRITE_JPEG_QUALITY), 100] diff --git a/frigate/data_processing/post/types.py b/frigate/data_processing/post/types.py index 6f1dc2ff1..9ce63e419 100644 --- a/frigate/data_processing/post/types.py +++ b/frigate/data_processing/post/types.py @@ -10,7 +10,7 @@ class ReviewMetadata(BaseModel): ) potential_threat_level: int | None = Field( default=None, - ge=0, + ge=1, le=3, - description="An integer representing the potential threat level (0-3). 0: No threat. 1: Minor anomaly. 2: Moderate concern. 3: High threat. Only include this field if a clear security concern is observable; otherwise, omit it.", + description="An integer representing the potential threat level (1-3). 1: Minor anomaly. 2: Moderate concern. 3: High threat. Only include this field if a clear security concern is observable; otherwise, omit it.", )