mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-03 06:50:58 +00:00
Add face recognition model size to ui config
This commit is contained in:
parent
88c2ed4898
commit
7043132462
@ -107,7 +107,19 @@
|
|||||||
"faceRecognition": {
|
"faceRecognition": {
|
||||||
"title": "Face Recognition",
|
"title": "Face Recognition",
|
||||||
"desc": "Face recognition allows people to be assigned names and when their face is recognized Frigate will assign the person's name as a sub label. This information is included in the UI, filters, as well as in notifications.",
|
"desc": "Face recognition allows people to be assigned names and when their face is recognized Frigate will assign the person's name as a sub label. This information is included in the UI, filters, as well as in notifications.",
|
||||||
"readTheDocumentation": "Read the Documentation"
|
"readTheDocumentation": "Read the Documentation",
|
||||||
|
"modelSize": {
|
||||||
|
"label": "Model Size",
|
||||||
|
"desc": "The size of the model used for face recognition.",
|
||||||
|
"small": {
|
||||||
|
"title": "small",
|
||||||
|
"desc": "Using <em>small</em> employs a Local Binary Pattern Histogram model via OpenCV that runs efficiently on most CPUs."
|
||||||
|
},
|
||||||
|
"large": {
|
||||||
|
"title": "large",
|
||||||
|
"desc": "Using <em>large</em> employs an ArcFace Face embedding model and will automatically run on the GPU if applicable."
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"licensePlateRecognition": {
|
"licensePlateRecognition": {
|
||||||
"title": "License Plate Recognition",
|
"title": "License Plate Recognition",
|
||||||
|
|||||||
@ -333,6 +333,7 @@ export interface FrigateConfig {
|
|||||||
|
|
||||||
face_recognition: {
|
face_recognition: {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
model_size: SearchModelSize;
|
||||||
detection_threshold: number;
|
detection_threshold: number;
|
||||||
recognition_threshold: number;
|
recognition_threshold: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -30,6 +30,7 @@ type ClassificationSettings = {
|
|||||||
};
|
};
|
||||||
face: {
|
face: {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
|
model_size?: SearchModelSize;
|
||||||
};
|
};
|
||||||
lpr: {
|
lpr: {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
@ -59,6 +60,7 @@ export default function ClassificationSettingsView({
|
|||||||
},
|
},
|
||||||
face: {
|
face: {
|
||||||
enabled: undefined,
|
enabled: undefined,
|
||||||
|
model_size: undefined,
|
||||||
},
|
},
|
||||||
lpr: {
|
lpr: {
|
||||||
enabled: undefined,
|
enabled: undefined,
|
||||||
@ -74,6 +76,7 @@ export default function ClassificationSettingsView({
|
|||||||
},
|
},
|
||||||
face: {
|
face: {
|
||||||
enabled: undefined,
|
enabled: undefined,
|
||||||
|
model_size: undefined,
|
||||||
},
|
},
|
||||||
lpr: {
|
lpr: {
|
||||||
enabled: undefined,
|
enabled: undefined,
|
||||||
@ -91,6 +94,7 @@ export default function ClassificationSettingsView({
|
|||||||
},
|
},
|
||||||
face: {
|
face: {
|
||||||
enabled: config.face_recognition.enabled,
|
enabled: config.face_recognition.enabled,
|
||||||
|
model_size: config.face_recognition.model_size,
|
||||||
},
|
},
|
||||||
lpr: {
|
lpr: {
|
||||||
enabled: config.lpr.enabled,
|
enabled: config.lpr.enabled,
|
||||||
@ -106,6 +110,7 @@ export default function ClassificationSettingsView({
|
|||||||
},
|
},
|
||||||
face: {
|
face: {
|
||||||
enabled: config.face_recognition.enabled,
|
enabled: config.face_recognition.enabled,
|
||||||
|
model_size: config.face_recognition.model_size,
|
||||||
},
|
},
|
||||||
lpr: {
|
lpr: {
|
||||||
enabled: config.lpr.enabled,
|
enabled: config.lpr.enabled,
|
||||||
@ -136,7 +141,7 @@ export default function ClassificationSettingsView({
|
|||||||
|
|
||||||
axios
|
axios
|
||||||
.put(
|
.put(
|
||||||
`config/set?semantic_search.enabled=${classificationSettings.search.enabled ? "True" : "False"}&semantic_search.reindex=${classificationSettings.search.reindex ? "True" : "False"}&semantic_search.model_size=${classificationSettings.search.model_size}&face_recognition.enabled=${classificationSettings.face.enabled ? "True" : "False"}&lpr.enabled=${classificationSettings.lpr.enabled ? "True" : "False"}`,
|
`config/set?semantic_search.enabled=${classificationSettings.search.enabled ? "True" : "False"}&semantic_search.reindex=${classificationSettings.search.reindex ? "True" : "False"}&semantic_search.model_size=${classificationSettings.search.model_size}&face_recognition.enabled=${classificationSettings.face.enabled ? "True" : "False"}&face_recognition.model_size=${classificationSettings.face.model_size}&lpr.enabled=${classificationSettings.lpr.enabled ? "True" : "False"}`,
|
||||||
{
|
{
|
||||||
requires_restart: 0,
|
requires_restart: 0,
|
||||||
},
|
},
|
||||||
@ -384,6 +389,61 @@ export default function ClassificationSettingsView({
|
|||||||
</Label>
|
</Label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="space-y-0.5">
|
||||||
|
<div className="text-md">
|
||||||
|
{t("classification.faceRecognition.modelSize.label")}
|
||||||
|
</div>
|
||||||
|
<div className="space-y-1 text-sm text-muted-foreground">
|
||||||
|
<p>
|
||||||
|
<Trans ns="views/settings">
|
||||||
|
classification.faceRecognition.modelSize.desc
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
<ul className="list-disc pl-5 text-sm">
|
||||||
|
<li>
|
||||||
|
<Trans ns="views/settings">
|
||||||
|
classification.faceRecognition.modelSize.small.desc
|
||||||
|
</Trans>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<Trans ns="views/settings">
|
||||||
|
classification.faceRecognition.modelSize.large.desc
|
||||||
|
</Trans>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Select
|
||||||
|
value={classificationSettings.face.model_size}
|
||||||
|
onValueChange={(value) =>
|
||||||
|
handleClassificationConfigChange({
|
||||||
|
face: {
|
||||||
|
model_size: value as SearchModelSize,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<SelectTrigger className="w-20">
|
||||||
|
{classificationSettings.search.model_size}
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectGroup>
|
||||||
|
{["small", "large"].map((size) => (
|
||||||
|
<SelectItem
|
||||||
|
key={size}
|
||||||
|
className="cursor-pointer"
|
||||||
|
value={size}
|
||||||
|
>
|
||||||
|
{t(
|
||||||
|
"classification.faceRecognition.modelSize." +
|
||||||
|
size +
|
||||||
|
".title",
|
||||||
|
)}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectGroup>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Separator className="my-2 flex bg-secondary" />
|
<Separator className="my-2 flex bg-secondary" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user