Prompt improvements and image saving

This commit is contained in:
Nicolas Mowen 2025-08-07 05:52:51 -06:00
parent 9316f0ea80
commit 8f77aa288c
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -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.",
)