fix nms sync call

pull/293/head
Vladimir Mandic 2020-11-06 19:25:37 -05:00
parent d8867fd1b4
commit 481b89ec9c
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ class HandDetector {
const scores = tf.tidy(() => tf.sigmoid(tf.slice(prediction, [0, 0], [-1, 1])).squeeze());
const rawBoxes = tf.slice(prediction, [0, 1], [-1, 4]);
const boxes = this.normalizeBoxes(rawBoxes);
const boxesWithHandsTensor = tf.image.nonMaxSuppression(boxes, scores, config.maxHands, config.iouThreshold, 0.95); // config.scoreThreshold
const boxesWithHandsTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, config.maxHands, config.iouThreshold, config.scoreThreshold);
const boxesWithHands = boxesWithHandsTensor.arraySync();
const toDispose = [
batchedPrediction,