Genai descriptions are not generated until tracked objects end (#15561)

This commit is contained in:
Josh Hawkins 2024-12-17 17:33:04 -06:00 committed by GitHub
parent d9ef8fa206
commit 3dc26e78ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 84 additions and 52 deletions

View File

@ -5,6 +5,8 @@ title: Generative AI
Generative AI can be used to automatically generate descriptive text based on the thumbnails of your tracked objects. This helps with [Semantic Search](/configuration/semantic_search) in Frigate to provide more context about your tracked objects. Descriptions are accessed via the _Explore_ view in the Frigate UI by clicking on a tracked object's thumbnail. Generative AI can be used to automatically generate descriptive text based on the thumbnails of your tracked objects. This helps with [Semantic Search](/configuration/semantic_search) in Frigate to provide more context about your tracked objects. Descriptions are accessed via the _Explore_ view in the Frigate UI by clicking on a tracked object's thumbnail.
Requests for a description are sent off automatically to your AI provider at the end of the tracked object's lifecycle. Descriptions can also be regenerated manually via the Frigate UI.
:::info :::info
Semantic Search must be enabled to use Generative AI. Semantic Search must be enabled to use Generative AI.

View File

@ -469,6 +469,30 @@ function ObjectDetailsTab({
</div> </div>
</div> </div>
<div className="flex flex-col gap-1.5"> <div className="flex flex-col gap-1.5">
{config?.cameras[search.camera].genai.enabled &&
!search.end_time &&
(config.cameras[search.camera].genai.required_zones.length === 0 ||
search.zones.some((zone) =>
config.cameras[search.camera].genai.required_zones.includes(zone),
)) &&
(config.cameras[search.camera].genai.objects.length === 0 ||
config.cameras[search.camera].genai.objects.includes(
search.label,
)) ? (
<>
<div className="text-sm text-primary/40">Description</div>
<div className="flex h-64 flex-col items-center justify-center gap-3 border p-4 text-sm text-primary/40">
<div className="flex">
<ActivityIndicator />
</div>
<div className="flex">
Frigate will not request a description from your Generative AI
provider until the tracked object's lifecycle has ended.
</div>
</div>
</>
) : (
<>
<div className="text-sm text-primary/40">Description</div> <div className="text-sm text-primary/40">Description</div>
<Textarea <Textarea
className="h-64" className="h-64"
@ -476,9 +500,13 @@ function ObjectDetailsTab({
value={desc} value={desc}
onChange={(e) => setDesc(e.target.value)} onChange={(e) => setDesc(e.target.value)}
/> />
</>
)}
<div className="flex w-full flex-row justify-end gap-2"> <div className="flex w-full flex-row justify-end gap-2">
{config?.cameras[search.camera].genai.enabled && ( {config?.cameras[search.camera].genai.enabled && search.end_time && (
<div className="flex items-center"> <>
<div className="flex items-start">
<Button <Button
className="rounded-r-none border-r-0" className="rounded-r-none border-r-0"
aria-label="Regenerate tracked object description" aria-label="Regenerate tracked object description"
@ -515,7 +543,7 @@ function ObjectDetailsTab({
</DropdownMenu> </DropdownMenu>
)} )}
</div> </div>
)}
<Button <Button
variant="select" variant="select"
aria-label="Save" aria-label="Save"
@ -523,6 +551,8 @@ function ObjectDetailsTab({
> >
Save Save
</Button> </Button>
</>
)}
</div> </div>
</div> </div>
</div> </div>