mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 15:05:26 +03:00
Compare commits
2 Commits
e32d250f39
...
726ded74b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
726ded74b6 | ||
|
|
0f4ebb812e |
@ -925,11 +925,11 @@ function FaceAttemptGroup({
|
|||||||
[onRefresh, t],
|
[onRefresh, t],
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create ClassifiedEvent from Event (face recognition uses sub_label)
|
|
||||||
const classifiedEvent: ClassifiedEvent | undefined = useMemo(() => {
|
const classifiedEvent: ClassifiedEvent | undefined = useMemo(() => {
|
||||||
if (!event || !event.sub_label || event.sub_label === "none") {
|
if (!event) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: event.id,
|
id: event.id,
|
||||||
label: event.sub_label,
|
label: event.sub_label,
|
||||||
|
|||||||
@ -79,6 +79,24 @@ i18n
|
|||||||
parseMissingKeyHandler: (key: string) => {
|
parseMissingKeyHandler: (key: string) => {
|
||||||
const parts = key.split(".");
|
const parts = key.split(".");
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.warn(`Missing translation key: ${key}`);
|
||||||
|
|
||||||
|
if (parts[0] === "time" && parts[1]?.includes("formattedTimestamp")) {
|
||||||
|
// Extract the format type from the last part (12hour, 24hour)
|
||||||
|
const formatType = parts[parts.length - 1];
|
||||||
|
|
||||||
|
// Return actual date-fns format strings as fallbacks
|
||||||
|
const formatDefaults: Record<string, string> = {
|
||||||
|
"12hour": "h:mm aaa",
|
||||||
|
"24hour": "HH:mm",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (formatDefaults[formatType]) {
|
||||||
|
return formatDefaults[formatType];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Handle special cases for objects and audio
|
// Handle special cases for objects and audio
|
||||||
if (parts[0] === "object" || parts[0] === "audio") {
|
if (parts[0] === "object" || parts[0] === "audio") {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -1043,34 +1043,22 @@ function ObjectTrainGrid({
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const classificationType = model.object_config.classification_type;
|
let label: string | undefined = undefined;
|
||||||
|
let score: number | undefined = undefined;
|
||||||
|
|
||||||
if (classificationType === "attribute") {
|
if (model.object_config.classification_type === "attribute") {
|
||||||
// For attribute type, look at event.data[model.name]
|
label = event.data[model.name] as string | undefined;
|
||||||
const attributeValue = event.data[model.name] as string | undefined;
|
score = event.data[`${model.name}_score`] as number | undefined;
|
||||||
const attributeScore = event.data[`${model.name}_score`] as
|
|
||||||
| number
|
|
||||||
| undefined;
|
|
||||||
|
|
||||||
if (attributeValue && attributeValue !== "none") {
|
|
||||||
return {
|
|
||||||
id: event.id,
|
|
||||||
label: attributeValue,
|
|
||||||
score: attributeScore,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// For sub_label type, use event.sub_label
|
label = event.sub_label;
|
||||||
if (event.sub_label && event.sub_label !== "none") {
|
score = event.data.sub_label_score;
|
||||||
return {
|
|
||||||
id: event.id,
|
|
||||||
label: event.sub_label,
|
|
||||||
score: event.data?.sub_label_score,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return {
|
||||||
|
id: event.id,
|
||||||
|
label: label,
|
||||||
|
score: score,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
[model],
|
[model],
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user