mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-27 17:17:40 +03:00
Improve score handling
This commit is contained in:
parent
44c85d3136
commit
79ab6f00df
@ -152,7 +152,7 @@ class CustomStateClassificationProcessor(RealTimeProcessorApi):
|
||||
score,
|
||||
)
|
||||
|
||||
if score >= camera_config.threshold:
|
||||
if score >= self.model_config.threshold:
|
||||
self.requestor.send_data(
|
||||
f"{camera}/classification/{self.model_config.name}",
|
||||
self.labelmap[best_id],
|
||||
@ -271,6 +271,10 @@ class CustomObjectClassificationProcessor(RealTimeProcessorApi):
|
||||
score,
|
||||
)
|
||||
|
||||
if score < self.model_config.threshold:
|
||||
logger.debug(f"Score {score} is less than threshold.")
|
||||
return
|
||||
|
||||
if score <= previous_score:
|
||||
logger.debug(f"Score {score} is worse than previous score {previous_score}")
|
||||
return
|
||||
|
||||
@ -640,15 +640,17 @@ function TrainGrid({
|
||||
trainImages
|
||||
.map((raw) => {
|
||||
const parts = raw.replaceAll(".webp", "").split("-");
|
||||
const rawScore = Number.parseFloat(parts[2]);
|
||||
return {
|
||||
raw,
|
||||
timestamp: parts[0],
|
||||
label: parts[1],
|
||||
score: Number.parseFloat(parts[2]) * 100,
|
||||
score: rawScore * 100,
|
||||
truePositive: rawScore >= model.threshold,
|
||||
};
|
||||
})
|
||||
.sort((a, b) => b.timestamp.localeCompare(a.timestamp)),
|
||||
[trainImages],
|
||||
[model, trainImages],
|
||||
);
|
||||
|
||||
return (
|
||||
@ -684,7 +686,14 @@ function TrainGrid({
|
||||
<div className="smart-capitalize">
|
||||
{data.label.replaceAll("_", " ")}
|
||||
</div>
|
||||
<div>{data.score}%</div>
|
||||
<div
|
||||
className={cn(
|
||||
"",
|
||||
data.truePositive ? "text-success" : "text-danger",
|
||||
)}
|
||||
>
|
||||
{data.score}%
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-row items-start justify-end gap-5 md:gap-4">
|
||||
<ClassificationSelectionDialog
|
||||
|
||||
Loading…
Reference in New Issue
Block a user