This commit is contained in:
Dragon Fire
2024-05-09 15:19:37 -04:00
parent f2147f3d85
commit f969002118
+1 -1
View File
@@ -77,7 +77,7 @@ module.exports = class Tensorflow {
const desiredHeight = 400;
const aspectRatio = originalWidth / originalHeight;
const newWidth = Math.round(desiredHeight / aspectRatio);
const resizedImage = tf.image.resizeBilinear(imageTensor, [desiredHeight, newWidth]);
const resizedImage = tf.image.resizeBilinear(imageTensor, [newWidth, desiredHeight]);
imageTensor.dispose();
const loadedImage = resizedImage.toFloat().div(tf.scalar(255)).expandDims();
resizedImage.dispose();