Compare commits

...

7 Commits

Author SHA1 Message Date
Nicolas Mowen
0412337e99 fix 2025-11-07 20:38:23 -07:00
Josh Hawkins
c38804018c also pad on review end_time 2025-11-07 18:19:40 -06:00
Josh Hawkins
8394aebb78 catch events with review items that start after the first timeline entry
review items may start later than events within them, so subtract a padding from the start time in the filter so the start of events are not incorrectly filtered out of the list in the detail stream
2025-11-07 18:11:30 -06:00
Josh Hawkins
37a7642501 fix overflowing truncated review item description in detail stream 2025-11-07 17:56:47 -06:00
Nicolas Mowen
affdc66315 Improve title and description for review genai 2025-11-07 16:55:26 -07:00
Nicolas Mowen
c3dd8ebaa4 Don't fail on file system error 2025-11-07 16:43:58 -07:00
Nicolas Mowen
12c9ca53b6 Don't fail to show 0% when showing classification 2025-11-07 15:39:54 -07:00
4 changed files with 14 additions and 10 deletions

View File

@ -546,5 +546,8 @@ def write_classification_attempt(
)
# delete oldest face image if maximum is reached
if len(files) > max_files:
os.unlink(os.path.join(folder, files[-1]))
try:
if len(files) > max_files:
os.unlink(os.path.join(folder, files[-1]))
except FileNotFoundError:
pass

View File

@ -113,8 +113,8 @@ When forming your description:
## Response Format
Your response MUST be a flat JSON object with:
- `title` (string): A concise, direct title that describes the purpose or overall action, not just what you literally see. {"Use spatial context when available to make titles more meaningful." if camera_context_section else ""} Use names from "Objects in Scene" based on what you visually observe. If you see both a name and an unidentified object of the same type but visually observe only one person/object, use ONLY the name. Examples: "Joe walking dog", "Person taking out trash", "Joe accessing vehicle", "Person leaving porch for driveway", "Joe and person on front porch".
- `scene` (string): A narrative description of what happens across the sequence from start to finish. **Only describe actions you can actually observe happening in the frames provided.** Do not infer or assume actions that aren't visible (e.g., if you see someone walking but never see them sit, don't say they sat down). Include setting, detected objects, and their observable actions. Avoid speculation or filling in assumed behaviors. Your description should align with and support the threat level you assign.
- `title` (string): A concise, direct title that describes the primary action or event in the sequence, not just what you literally see. {"Use spatial context when available to make titles more meaningful." if camera_context_section else ""} When multiple objects/actions are present, prioritize whichever is most prominent or occurs first. Use names from "Objects in Scene" based on what you visually observe. If you see both a name and an unidentified object of the same type but visually observe only one person/object, use ONLY the name. Examples: "Joe walking dog", "Person taking out trash", "Vehicle arriving in driveway", "Joe accessing vehicle", "Person leaving porch for driveway".
- `scene` (string): A narrative description of what happens across the sequence from start to finish, in chronological order. Start by describing how the sequence begins, then describe the progression of events. **Describe all significant movements and actions in the order they occur.** For example, if a vehicle arrives and then a person exits, describe both actions sequentially. **Only describe actions you can actually observe happening in the frames provided.** Do not infer or assume actions that aren't visible (e.g., if you see someone walking but never see them sit, don't say they sat down). Include setting, detected objects, and their observable actions. Avoid speculation or filling in assumed behaviors. Your description should align with and support the threat level you assign.
- `confidence` (float): 0-1 confidence in your analysis. Higher confidence when objects/actions are clearly visible and context is unambiguous. Lower confidence when the sequence is unclear, objects are partially obscured, or context is ambiguous.
- `potential_threat_level` (integer): 0, 1, or 2 as defined in "Normal Activity Patterns for This Property" above. Your threat level must be consistent with your scene description and the guidance above.
{get_concern_prompt()}

View File

@ -148,13 +148,13 @@ export const ClassificationCard = forwardRef<
<div
className={cn(
"flex flex-col items-start text-white",
data.score ? "text-xs" : "text-sm",
data.score != undefined ? "text-xs" : "text-sm",
)}
>
<div className="smart-capitalize">
{data.name == "unknown" ? t("details.unknown") : data.name}
</div>
{data.score && (
{data.score != undefined && (
<div
className={cn(
"",

View File

@ -15,7 +15,7 @@ import useSWR from "swr";
import ActivityIndicator from "../indicators/activity-indicator";
import { Event } from "@/types/event";
import { getIconForLabel } from "@/utils/iconUtil";
import { ReviewSegment } from "@/types/review";
import { REVIEW_PADDING, ReviewSegment } from "@/types/review";
import { LuChevronDown, LuCircle, LuChevronRight } from "react-icons/lu";
import { getTranslatedLabel } from "@/utils/i18n";
import EventMenu from "@/components/timeline/EventMenu";
@ -392,7 +392,7 @@ function ReviewGroup({
/>
</div>
<div className="mr-3 flex w-full justify-between">
<div className="ml-1 flex flex-col items-start gap-1.5">
<div className="ml-1 mr-6 flex min-w-0 flex-col items-start gap-1.5">
<div className="flex flex-row gap-3">
<div className="text-sm font-medium">{displayTime}</div>
<div className="relative flex items-center gap-2 text-white">
@ -803,8 +803,9 @@ function ObjectTimeline({
return fullTimeline
.filter(
(t) =>
t.timestamp >= review.start_time &&
(review.end_time == undefined || t.timestamp <= review.end_time),
t.timestamp >= review.start_time - REVIEW_PADDING &&
(review.end_time == undefined ||
t.timestamp <= review.end_time + REVIEW_PADDING),
)
.map((event) => ({
...event,