From 83fa651adaa9b0cb06848d5a55927b8f2e2371ab Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 24 Oct 2025 15:38:35 -0600 Subject: [PATCH] Various fixes (#20655) --- frigate/genai/ollama.py | 4 ++-- web/src/components/card/ClassificationCard.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/genai/ollama.py b/frigate/genai/ollama.py index 5e51de085..4649e83c5 100644 --- a/frigate/genai/ollama.py +++ b/frigate/genai/ollama.py @@ -20,8 +20,8 @@ class OllamaClient(GenAIClient): LOCAL_OPTIMIZED_OPTIONS = { "options": { "temperature": 0.5, - "repeat_penalty": 1.15, - "presence_penalty": 0.1, + "repeat_penalty": 1.05, + "presence_penalty": 0.3, }, } diff --git a/web/src/components/card/ClassificationCard.tsx b/web/src/components/card/ClassificationCard.tsx index 15404db1b..21f498fe4 100644 --- a/web/src/components/card/ClassificationCard.tsx +++ b/web/src/components/card/ClassificationCard.tsx @@ -214,7 +214,9 @@ export function GroupedClassificationCard({ }); if (!best) { - return group.at(-1); + // select an item from the middle of the time series as this usually correlates + // to a more representative image than the first or last + return group.at(Math.floor(group.length / 2)); } const bestTyped: ClassificationItemData = best;