fix: confidence off by factor 100 for offline results (#2651)

Offline meaning results coming from the vision-plugin, i.e. prediction from file and frame processor.
This commit is contained in:
Johannes Klein
2025-02-06 14:03:55 +01:00
committed by GitHub
parent 5b8fbf048b
commit 63bb66c8ce

View File

@@ -1,7 +1,11 @@
const calculateConfidence = suggestion => {
if ( !suggestion ) { return null; }
if ( !suggestion ) {
return null;
}
// Note: combined_score have values between 0 and 100,
// compared with vision-plugin v4.2.2 model results that have scores between 0 and 1
const score = suggestion?.score
? suggestion.score
? ( suggestion.score * 100 )
: suggestion.combined_score;
const confidence = parseFloat( score.toFixed( 1 ) );
return confidence;