From 63bb66c8ce093c2e849029aea7ee63ab5f68cf50 Mon Sep 17 00:00:00 2001 From: Johannes Klein Date: Thu, 6 Feb 2025 14:03:55 +0100 Subject: [PATCH] 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. --- src/components/Match/calculateConfidence.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Match/calculateConfidence.js b/src/components/Match/calculateConfidence.js index e96cf2aad..fa8f71dac 100644 --- a/src/components/Match/calculateConfidence.js +++ b/src/components/Match/calculateConfidence.js @@ -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;