Fix empty detection bug #135

Merged
jgeorgi merged 1 commits from xps-fix-postprocess into main 2024-03-11 16:47:26 +00:00
Showing only changes of commit ea19b1509a - Show all commits

View File

@@ -43,6 +43,8 @@ export default {
rawBoxes.push(boxCalc)
rawScores.push(getScores)
}
if (rawBoxes.length > 0) {
const tBoxes = tf.tensor2d(rawBoxes)
let tScores = null
let structureScores = null
@@ -62,6 +64,8 @@ export default {
}
}
tf.dispose(tBoxes)
tf.dispose(tScores)
const valid_detections_data = classes_data.length
var output = {
detections: []
@@ -77,14 +81,12 @@ export default {
"confidence": scores_data[i] * 100
})
}
}
tf.dispose(res)
tf.dispose(tBoxes)
tf.dispose(tScores)
tf.dispose(input)
console.timeEnd('post-process')
return output
return output || { detections: [] }
},
getRemoteLabels() {
var self = this