mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-06-22 06:28:42 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user