mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-22 20:18:30 +03:00
Show event in all cases, even without non-none match
This commit is contained in:
parent
e32d250f39
commit
0f4ebb812e
@ -925,11 +925,11 @@ function FaceAttemptGroup({
|
||||
[onRefresh, t],
|
||||
);
|
||||
|
||||
// Create ClassifiedEvent from Event (face recognition uses sub_label)
|
||||
const classifiedEvent: ClassifiedEvent | undefined = useMemo(() => {
|
||||
if (!event || !event.sub_label || event.sub_label === "none") {
|
||||
if (!event) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
id: event.id,
|
||||
label: event.sub_label,
|
||||
|
||||
@ -1043,34 +1043,22 @@ function ObjectTrainGrid({
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const classificationType = model.object_config.classification_type;
|
||||
let label: string | undefined = undefined;
|
||||
let score: number | undefined = undefined;
|
||||
|
||||
if (classificationType === "attribute") {
|
||||
// For attribute type, look at event.data[model.name]
|
||||
const attributeValue = event.data[model.name] as string | undefined;
|
||||
const attributeScore = event.data[`${model.name}_score`] as
|
||||
| number
|
||||
| undefined;
|
||||
|
||||
if (attributeValue && attributeValue !== "none") {
|
||||
return {
|
||||
id: event.id,
|
||||
label: attributeValue,
|
||||
score: attributeScore,
|
||||
};
|
||||
}
|
||||
if (model.object_config.classification_type === "attribute") {
|
||||
label = event.data[model.name] as string | undefined;
|
||||
score = event.data[`${model.name}_score`] as number | undefined;
|
||||
} else {
|
||||
// For sub_label type, use event.sub_label
|
||||
if (event.sub_label && event.sub_label !== "none") {
|
||||
return {
|
||||
id: event.id,
|
||||
label: event.sub_label,
|
||||
score: event.data?.sub_label_score,
|
||||
};
|
||||
}
|
||||
label = event.sub_label;
|
||||
score = event.data.sub_label_score;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return {
|
||||
id: event.id,
|
||||
label: label,
|
||||
score: score,
|
||||
};
|
||||
},
|
||||
[model],
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user