This commit is contained in:
Dragon Fire
2024-05-08 18:30:25 -04:00
parent be7ef70087
commit dc12937bbc
+1
View File
@@ -83,6 +83,7 @@ module.exports = class Tensorflow {
const stylizedImage = await this.transformerModel.predict([loadedImage, stylePrediction]);
loadedImage.dispose();
stylePrediction.dispose();
stylizedImage.mul(255).toInt();
const buffer = await tf.node.encodeJpeg(stylizedImage.squeeze());
stylizedImage.dispose();
return Buffer.from(buffer);