From 952e0f8d22841e19c473aaa99caba65d5499fac7 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 9 May 2024 15:28:51 -0400 Subject: [PATCH] Fix --- structures/Tensorflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structures/Tensorflow.js b/structures/Tensorflow.js index 0e42c0bb..a0d04ca2 100644 --- a/structures/Tensorflow.js +++ b/structures/Tensorflow.js @@ -76,7 +76,7 @@ module.exports = class Tensorflow { const [originalHeight, originalWidth] = imageTensor.shape.slice(0, 2); const desiredHeight = 400; const aspectRatio = originalWidth / originalHeight; - const newWidth = Math.round(desiredHeight / aspectRatio); + const newWidth = Math.round(desiredHeight * aspectRatio); const resizedImage = tf.image.resizeBilinear(imageTensor, [desiredHeight, newWidth]); imageTensor.dispose(); const loadedImage = resizedImage.toFloat().div(tf.scalar(255)).expandDims();