diff --git a/assets/images/spaghetti.jpg b/assets/images/spaghetti.jpg index 7827d9e5..0fe8b695 100644 Binary files a/assets/images/spaghetti.jpg and b/assets/images/spaghetti.jpg differ diff --git a/structures/Tensorflow.js b/structures/Tensorflow.js index df446419..0e42c0bb 100644 --- a/structures/Tensorflow.js +++ b/structures/Tensorflow.js @@ -74,10 +74,10 @@ module.exports = class Tensorflow { async stylizeImage(image, styleImg) { const imageTensor = await tf.node.decodeImage(image, 3); const [originalHeight, originalWidth] = imageTensor.shape.slice(0, 2); - const desiredHeight = 300; + const desiredHeight = 400; const aspectRatio = originalWidth / originalHeight; const newWidth = Math.round(desiredHeight / aspectRatio); - const resizedImage = tf.image.resizeBilinear(imageTensor, [newWidth, desiredHeight]); + const resizedImage = tf.image.resizeBilinear(imageTensor, [desiredHeight, newWidth]); imageTensor.dispose(); const loadedImage = resizedImage.toFloat().div(tf.scalar(255)).expandDims(); resizedImage.dispose();