mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-31 16:25:26 +03:00
Compare commits
No commits in common. "8c318699c4ff0b6ddfd097ca228c1210556e16a5" and "cac2adde31994b7fd9f4e9de5985ca75d0143a4a" have entirely different histories.
8c318699c4
...
cac2adde31
@ -671,18 +671,20 @@ lpr:
|
|||||||
# Optional: List of regex replacement rules to normalize detected plates (default: shown below)
|
# Optional: List of regex replacement rules to normalize detected plates (default: shown below)
|
||||||
replace_rules: {}
|
replace_rules: {}
|
||||||
|
|
||||||
# Optional: Configuration for AI / LLM provider
|
# Optional: Configuration for AI generated tracked object descriptions
|
||||||
# WARNING: Depending on the provider, this will send thumbnails over the internet
|
# WARNING: Depending on the provider, this will send thumbnails over the internet
|
||||||
# to Google or OpenAI's LLMs to generate descriptions. GenAI features can be configured at
|
# to Google or OpenAI's LLMs to generate descriptions. It can be overridden at
|
||||||
# the camera level to enhance privacy for indoor cameras.
|
# the camera level (enabled: False) to enhance privacy for indoor cameras.
|
||||||
genai:
|
genai:
|
||||||
# Required: Provider must be one of ollama, gemini, or openai
|
# Optional: Enable AI description generation (default: shown below)
|
||||||
|
enabled: False
|
||||||
|
# Required if enabled: Provider must be one of ollama, gemini, or openai
|
||||||
provider: ollama
|
provider: ollama
|
||||||
# Required if provider is ollama. May also be used for an OpenAI API compatible backend with the openai provider.
|
# Required if provider is ollama. May also be used for an OpenAI API compatible backend with the openai provider.
|
||||||
base_url: http://localhost::11434
|
base_url: http://localhost::11434
|
||||||
# Required if gemini or openai
|
# Required if gemini or openai
|
||||||
api_key: "{FRIGATE_GENAI_API_KEY}"
|
api_key: "{FRIGATE_GENAI_API_KEY}"
|
||||||
# Required: The model to use with the provider.
|
# Required if enabled: The model to use with the provider.
|
||||||
model: gemini-1.5-flash
|
model: gemini-1.5-flash
|
||||||
# Optional additional args to pass to the GenAI Provider (default: None)
|
# Optional additional args to pass to the GenAI Provider (default: None)
|
||||||
provider_options:
|
provider_options:
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class BirdClassificationConfig(FrigateBaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class CustomClassificationStateCameraConfig(FrigateBaseModel):
|
class CustomClassificationStateCameraConfig(FrigateBaseModel):
|
||||||
crop: list[float, float, float, float] = Field(
|
crop: list[int, int, int, int] = Field(
|
||||||
title="Crop of image frame on this camera to run classification on."
|
title="Crop of image frame on this camera to run classification on."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -100,10 +100,10 @@ class CustomStateClassificationProcessor(RealTimeProcessorApi):
|
|||||||
|
|
||||||
camera_config = self.model_config.state_config.cameras[camera]
|
camera_config = self.model_config.state_config.cameras[camera]
|
||||||
crop = [
|
crop = [
|
||||||
camera_config.crop[0] * self.config.cameras[camera].detect.width,
|
camera_config.crop[0],
|
||||||
camera_config.crop[1] * self.config.cameras[camera].detect.height,
|
camera_config.crop[1],
|
||||||
camera_config.crop[2] * self.config.cameras[camera].detect.width,
|
camera_config.crop[2],
|
||||||
camera_config.crop[3] * self.config.cameras[camera].detect.height,
|
camera_config.crop[3],
|
||||||
]
|
]
|
||||||
should_run = False
|
should_run = False
|
||||||
|
|
||||||
|
|||||||
@ -49,9 +49,5 @@
|
|||||||
"new": "Create New Class"
|
"new": "Create New Class"
|
||||||
},
|
},
|
||||||
"categorizeImageAs": "Classify Image As:",
|
"categorizeImageAs": "Classify Image As:",
|
||||||
"categorizeImage": "Classify Image",
|
"categorizeImage": "Classify Image"
|
||||||
"wizard": {
|
|
||||||
"title": "Create New Classification",
|
|
||||||
"description": "Create a new state or object classification model."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,8 +33,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"train": {
|
"train": {
|
||||||
"title": "Recent Recognitions",
|
"title": "Train",
|
||||||
"aria": "Select recent recognitions",
|
"aria": "Select train",
|
||||||
"empty": "There are no recent face recognition attempts"
|
"empty": "There are no recent face recognition attempts"
|
||||||
},
|
},
|
||||||
"selectItem": "Select {{item}}",
|
"selectItem": "Select {{item}}",
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { getTranslatedLabel } from "@/utils/i18n";
|
import { getTranslatedLabel } from "@/utils/i18n";
|
||||||
|
|
||||||
type ClassificationCardProps = {
|
type ClassificationCardProps = {
|
||||||
|
className?: string;
|
||||||
imgClassName?: string;
|
imgClassName?: string;
|
||||||
data: ClassificationItemData;
|
data: ClassificationItemData;
|
||||||
threshold?: ClassificationThreshold;
|
threshold?: ClassificationThreshold;
|
||||||
@ -27,6 +28,7 @@ type ClassificationCardProps = {
|
|||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
};
|
};
|
||||||
export function ClassificationCard({
|
export function ClassificationCard({
|
||||||
|
className,
|
||||||
imgClassName,
|
imgClassName,
|
||||||
data,
|
data,
|
||||||
threshold,
|
threshold,
|
||||||
|
|||||||
@ -145,7 +145,7 @@ export default function ExportCard({
|
|||||||
<>
|
<>
|
||||||
{exportedRecording.thumb_path.length > 0 ? (
|
{exportedRecording.thumb_path.length > 0 ? (
|
||||||
<img
|
<img
|
||||||
className="absolute inset-0 aspect-video size-full rounded-lg object-cover md:rounded-2xl"
|
className="absolute inset-0 aspect-video size-full rounded-lg object-contain md:rounded-2xl"
|
||||||
src={`${baseUrl}${exportedRecording.thumb_path.replace("/media/frigate/", "")}`}
|
src={`${baseUrl}${exportedRecording.thumb_path.replace("/media/frigate/", "")}`}
|
||||||
onLoad={() => setLoading(false)}
|
onLoad={() => setLoading(false)}
|
||||||
/>
|
/>
|
||||||
@ -224,9 +224,10 @@ export default function ExportCard({
|
|||||||
{loading && (
|
{loading && (
|
||||||
<Skeleton className="absolute inset-0 aspect-video rounded-lg md:rounded-2xl" />
|
<Skeleton className="absolute inset-0 aspect-video rounded-lg md:rounded-2xl" />
|
||||||
)}
|
)}
|
||||||
<div className="rounded-b-l pointer-events-none absolute inset-x-0 bottom-0 h-[50%] rounded-lg bg-gradient-to-t from-black/60 to-transparent md:rounded-2xl" />
|
<div className="rounded-b-l pointer-events-none absolute inset-x-0 bottom-0 h-[20%] rounded-lg bg-gradient-to-t from-black/60 to-transparent md:rounded-2xl">
|
||||||
<div className="absolute bottom-2 left-3 flex h-full items-end justify-between text-white smart-capitalize">
|
<div className="mx-3 flex h-full items-end justify-between pb-1 text-sm text-white smart-capitalize">
|
||||||
{exportedRecording.name.replaceAll("_", " ")}
|
{exportedRecording.name.replaceAll("_", " ")}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -1,66 +0,0 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import StepIndicator from "../indicators/StepIndicator";
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
} from "../ui/dialog";
|
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
const STEPS = [
|
|
||||||
"classificationWizard.steps.nameAndDefine",
|
|
||||||
"classificationWizard.steps.stateArea",
|
|
||||||
"classificationWizard.steps.chooseExamples",
|
|
||||||
"classificationWizard.steps.train",
|
|
||||||
];
|
|
||||||
|
|
||||||
type ClassificationModelWizardDialogProps = {
|
|
||||||
open: boolean;
|
|
||||||
onClose: () => void;
|
|
||||||
};
|
|
||||||
export default function ClassificationModelWizardDialog({
|
|
||||||
open,
|
|
||||||
onClose,
|
|
||||||
}: ClassificationModelWizardDialogProps) {
|
|
||||||
const { t } = useTranslation(["views/classificationModel"]);
|
|
||||||
|
|
||||||
// step management
|
|
||||||
const [currentStep, _] = useState(0);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
open={open}
|
|
||||||
onOpenChange={(open) => {
|
|
||||||
if (!open) {
|
|
||||||
onClose;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<DialogContent
|
|
||||||
className="max-h-[90dvh] max-w-4xl overflow-y-auto"
|
|
||||||
onInteractOutside={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<StepIndicator
|
|
||||||
steps={STEPS}
|
|
||||||
currentStep={currentStep}
|
|
||||||
variant="dots"
|
|
||||||
className="mb-4 justify-start"
|
|
||||||
/>
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>{t("wizard.title")}</DialogTitle>
|
|
||||||
{currentStep === 0 && (
|
|
||||||
<DialogDescription>{t("wizard.description")}</DialogDescription>
|
|
||||||
)}
|
|
||||||
</DialogHeader>
|
|
||||||
|
|
||||||
<div className="pb-4">
|
|
||||||
<div className="size-full"></div>
|
|
||||||
</div>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -940,6 +940,7 @@ function FaceGrid({
|
|||||||
>
|
>
|
||||||
{sortedFaces.map((image: string) => (
|
{sortedFaces.map((image: string) => (
|
||||||
<ClassificationCard
|
<ClassificationCard
|
||||||
|
className="gap-2 rounded-lg bg-card p-2"
|
||||||
key={image}
|
key={image}
|
||||||
data={{
|
data={{
|
||||||
name: pageToggle,
|
name: pageToggle,
|
||||||
|
|||||||
@ -304,10 +304,10 @@ export type CustomClassificationModelConfig = {
|
|||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
threshold: number;
|
threshold: number;
|
||||||
object_config?: {
|
object_config: null | {
|
||||||
objects: string[];
|
objects: string[];
|
||||||
};
|
};
|
||||||
state_config?: {
|
state_config: null | {
|
||||||
cameras: {
|
cameras: {
|
||||||
[cameraName: string]: {
|
[cameraName: string]: {
|
||||||
crop: [number, number, number, number];
|
crop: [number, number, number, number];
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { baseUrl } from "@/api/baseUrl";
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
import ClassificationModelWizardDialog from "@/components/classification/ClassificationModelWizardDialog";
|
|
||||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
import ActivityIndicator from "@/components/indicators/activity-indicator";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||||
@ -53,10 +52,6 @@ export default function ModelSelectionView({
|
|||||||
});
|
});
|
||||||
}, [config, pageToggle]);
|
}, [config, pageToggle]);
|
||||||
|
|
||||||
// new model wizard
|
|
||||||
|
|
||||||
const [newModel, setNewModel] = useState(false);
|
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
return <ActivityIndicator />;
|
return <ActivityIndicator />;
|
||||||
}
|
}
|
||||||
@ -67,11 +62,6 @@ export default function ModelSelectionView({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex size-full flex-col p-2">
|
<div className="flex size-full flex-col p-2">
|
||||||
<ClassificationModelWizardDialog
|
|
||||||
open={newModel}
|
|
||||||
onClose={() => setNewModel(false)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="flex h-12 w-full items-center justify-between">
|
<div className="flex h-12 w-full items-center justify-between">
|
||||||
<div className="flex flex-row items-center">
|
<div className="flex flex-row items-center">
|
||||||
<ToggleGroup
|
<ToggleGroup
|
||||||
@ -103,11 +93,7 @@ export default function ModelSelectionView({
|
|||||||
</ToggleGroup>
|
</ToggleGroup>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row items-center">
|
<div className="flex flex-row items-center">
|
||||||
<Button
|
<Button className="flex flex-row items-center gap-2" variant="select">
|
||||||
className="flex flex-row items-center gap-2"
|
|
||||||
variant="select"
|
|
||||||
onClick={() => setNewModel(true)}
|
|
||||||
>
|
|
||||||
<FaFolderPlus />
|
<FaFolderPlus />
|
||||||
Add Classification
|
Add Classification
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -637,6 +637,7 @@ function DatasetGrid({
|
|||||||
{classData.map((image) => (
|
{classData.map((image) => (
|
||||||
<ClassificationCard
|
<ClassificationCard
|
||||||
key={image}
|
key={image}
|
||||||
|
className="w-60 gap-4 rounded-lg bg-card p-2"
|
||||||
imgClassName="size-auto"
|
imgClassName="size-auto"
|
||||||
data={{
|
data={{
|
||||||
filename: image,
|
filename: image,
|
||||||
@ -798,6 +799,7 @@ function StateTrainGrid({
|
|||||||
{trainData?.map((data) => (
|
{trainData?.map((data) => (
|
||||||
<ClassificationCard
|
<ClassificationCard
|
||||||
key={data.filename}
|
key={data.filename}
|
||||||
|
className="w-60 gap-2 rounded-lg bg-card p-2"
|
||||||
imgClassName="size-auto"
|
imgClassName="size-auto"
|
||||||
data={data}
|
data={data}
|
||||||
threshold={threshold}
|
threshold={threshold}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user