From 0670083e92584fa2557addb2688eb55d03e81db4 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 6 Nov 2020 19:25:37 -0500 Subject: [PATCH] fix nms sync call --- src/hand/handdetector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hand/handdetector.js b/src/hand/handdetector.js index 237c425f..6da76af9 100644 --- a/src/hand/handdetector.js +++ b/src/hand/handdetector.js @@ -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,