mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-31 08:09:02 +03:00
Miscellaneous fixes (0.17 Beta) (#21443)
* Use thread lock for JinaV2 call as it sets multiple internal fields while being called * fix audio label translation in explore filter * Show event in all cases, even without non-none match * improve i18n key fallback when translation files aren't loaded just display a valid time now instead of "invalid time" --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
co-authored by
Josh Hawkins
parent
3655b9269d
commit
e2a1208c90
@@ -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],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user