From a89693d829c65a76f0b737ef9e9ba2d130cc0dda Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Fri, 28 Jun 2024 11:48:51 -0700 Subject: [PATCH] Improve tensor handling in live detection Signed-off-by: Justin Georgi --- src/pages/detection-mixin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/detection-mixin.js b/src/pages/detection-mixin.js index aad01eb..d0b7197 100644 --- a/src/pages/detection-mixin.js +++ b/src/pages/detection-mixin.js @@ -222,6 +222,9 @@ export default { imageCtx.drawImage(target, pointX, pointY, 20, 20) } } + tf.dispose(input) + tf.dispose(res) + tf.dispose(rawRes) } catch (e) { console.log(e) }