mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-02 10:01:15 +03:00
Compare commits
4 Commits
95e8603055
...
2a4d3a5eb1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a4d3a5eb1 | ||
|
|
a1a9fd82a7 | ||
|
|
733c50c6e8 | ||
|
|
7f3118f1ef |
@ -2,7 +2,7 @@ from typing import Annotated
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StringConstraints
|
||||
|
||||
ObservationItem = Annotated[str, StringConstraints(min_length=20, max_length=160)]
|
||||
ObservationItem = Annotated[str, StringConstraints(min_length=20, max_length=200)]
|
||||
|
||||
|
||||
class ReviewMetadata(BaseModel):
|
||||
@ -11,19 +11,8 @@ class ReviewMetadata(BaseModel):
|
||||
observations: list[ObservationItem] = Field(
|
||||
...,
|
||||
min_length=3,
|
||||
max_length=15,
|
||||
description=(
|
||||
"Enumerate the significant observations across all frames, in "
|
||||
"chronological order, BEFORE composing the scene narrative. "
|
||||
"Include the very start of the activity — for example, a vehicle "
|
||||
"entering the frame or pulling into the driveway — even if it "
|
||||
"lasts only a few frames and the rest of the clip is dominated "
|
||||
"by a longer activity. Include each arrival, departure, motion "
|
||||
"event, object handled, and notable change in position or state. "
|
||||
"Each item is a single concrete fact written as a complete "
|
||||
"sentence. Do not summarize, interpret, or assign meaning here — "
|
||||
"that belongs in the scene field."
|
||||
),
|
||||
max_length=8,
|
||||
description="Enumerate the significant observations across all frames, in chronological order.",
|
||||
)
|
||||
scene: str = Field(
|
||||
min_length=150,
|
||||
@ -32,12 +21,12 @@ class ReviewMetadata(BaseModel):
|
||||
)
|
||||
title: str = Field(
|
||||
max_length=80,
|
||||
description="Under 10 words. Name the apparent purpose or outcome of the activity together with the location involved. Do not narrate or list the sequence of actions step by step.",
|
||||
description="Title for the activity.",
|
||||
)
|
||||
shortSummary: str = Field(
|
||||
min_length=70,
|
||||
max_length=120,
|
||||
description="A brief 2-sentence summary of the scene, suitable for notifications.",
|
||||
max_length=140,
|
||||
description="A brief summary for the activity.",
|
||||
)
|
||||
confidence: float = Field(
|
||||
ge=0.0,
|
||||
|
||||
@ -108,10 +108,11 @@ When forming your description:
|
||||
## Response Field Guidelines
|
||||
|
||||
Respond with a JSON object matching the provided schema. Field-specific guidance:
|
||||
- `observations`: Include the very start of the activity — for example, a vehicle entering the frame or pulling into the driveway — even if it lasts only a few frames and the rest of the clip is dominated by a longer activity. Include each arrival, departure, object handled, and notable change in position or state. Each item is a single concrete fact written as a complete sentence.
|
||||
- `scene`: Describe how the sequence begins, then the progression of events — all significant movements and actions in order. For example, if a vehicle arrives and then a person exits, describe both sequentially. For named subjects (those with a `←` separator in "Objects in Scene"), always use their name — do not replace them with generic terms. For unnamed objects (e.g., "person", "car"), refer to them naturally with articles (e.g., "a person", "the car"). Your description should align with and support the threat level you assign.
|
||||
- `title`: Name the primary activity across the observations, together with the location. An activity is what is being done with objects, tools, or surfaces; locomotion through the scene qualifies as the activity only when no other interaction is observed. For named subjects, always use their name. For unnamed objects, refer to them naturally with articles. No editorial qualifiers like "routine" or "suspicious."
|
||||
- `title`: Name the primary activity across the observations, together with the location. An activity is what is being done with objects, tools, or surfaces; locomotion through the scene qualifies as the activity only when no other interaction is observed. For named subjects, always use their name. For unnamed objects, refer to them naturally with articles.
|
||||
- `shortSummary`: Briefly summarize the primary activity across the observations.
|
||||
- `potential_threat_level`: Must be consistent with your scene description and the activity patterns above.
|
||||
{get_concern_prompt()}
|
||||
|
||||
## Sequence Details
|
||||
|
||||
|
||||
@ -91,7 +91,7 @@ export function ProfileSectionDropdown({
|
||||
className="group flex items-start justify-between gap-2"
|
||||
onClick={() => onSelectProfile(profile)}
|
||||
>
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<div className="flex flex-col items-start gap-2">
|
||||
<div className="flex w-full flex-row items-center justify-start gap-2">
|
||||
{isActive && <Check className="h-3.5 w-3.5 shrink-0" />}
|
||||
<span
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
CaseCard,
|
||||
ExportCard,
|
||||
} from "@/components/card/ExportCard";
|
||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogCancel,
|
||||
@ -864,6 +865,7 @@ function Exports() {
|
||||
search={search}
|
||||
selectedExports={selectedExports}
|
||||
selectionMode={selectionMode}
|
||||
isLoading={cases === undefined || rawExports === undefined}
|
||||
onSelectExport={onSelectExport}
|
||||
setSelected={setSelected}
|
||||
renameClip={onHandleRename}
|
||||
@ -882,6 +884,7 @@ function Exports() {
|
||||
activeJobs={activeJobsByCase["none"] || []}
|
||||
selectedExports={selectedExports}
|
||||
selectionMode={selectionMode}
|
||||
isLoading={cases === undefined || rawExports === undefined}
|
||||
onSelectExport={onSelectExport}
|
||||
setSelectedCaseId={setSelectedCaseId}
|
||||
setSelected={setSelected}
|
||||
@ -903,6 +906,7 @@ type AllExportsViewProps = {
|
||||
activeJobs: ExportJob[];
|
||||
selectedExports: Export[];
|
||||
selectionMode: boolean;
|
||||
isLoading: boolean;
|
||||
onSelectExport: (e: Export) => void;
|
||||
setSelectedCaseId: (id: string) => void;
|
||||
setSelected: (e: Export) => void;
|
||||
@ -919,6 +923,7 @@ function AllExportsView({
|
||||
activeJobs,
|
||||
selectedExports,
|
||||
selectionMode,
|
||||
isLoading,
|
||||
onSelectExport,
|
||||
setSelectedCaseId,
|
||||
setSelected,
|
||||
@ -1027,6 +1032,8 @@ function AllExportsView({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : isLoading ? (
|
||||
<ActivityIndicator className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
|
||||
) : (
|
||||
<div className="absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center text-center">
|
||||
<LuFolderX className="size-16" />
|
||||
@ -1046,6 +1053,7 @@ type CaseViewProps = {
|
||||
search: string;
|
||||
selectedExports: Export[];
|
||||
selectionMode: boolean;
|
||||
isLoading: boolean;
|
||||
onSelectExport: (e: Export) => void;
|
||||
setSelected: (e: Export) => void;
|
||||
renameClip: (id: string, update: string) => void;
|
||||
@ -1063,6 +1071,7 @@ function CaseView({
|
||||
search,
|
||||
selectedExports,
|
||||
selectionMode,
|
||||
isLoading,
|
||||
onSelectExport,
|
||||
setSelected,
|
||||
renameClip,
|
||||
@ -1201,6 +1210,10 @@ function CaseView({
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
) : isLoading ? (
|
||||
<div className="flex min-h-[16rem] flex-1 items-center justify-center">
|
||||
<ActivityIndicator />
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex min-h-[16rem] flex-col items-center justify-center p-6 text-center">
|
||||
<LuFolderX className="size-12" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user