mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Fix
This commit is contained in:
@@ -78,8 +78,10 @@ module.exports = class Tensorflow {
|
|||||||
const styleTensor = tf.node.decodeImage(styleImg, 3);
|
const styleTensor = tf.node.decodeImage(styleImg, 3);
|
||||||
const loadedStyle = styleTensor.div(tf.scalar(255)).expandDims();
|
const loadedStyle = styleTensor.div(tf.scalar(255)).expandDims();
|
||||||
styleTensor.dispose();
|
styleTensor.dispose();
|
||||||
const stylePrediction = await this.styleModel.predict(loadedStyle);
|
const reshapedStyle = loadedStyle.reshape([1, 1, 1, 100]);
|
||||||
loadedStyle.dispose();
|
loadedStyle.dispose();
|
||||||
|
const stylePrediction = await this.styleModel.predict(reshapedStyle);
|
||||||
|
reshapedStyle.dispose();
|
||||||
const stylizedImage = await this.transformerModel.predict([loadedImage, stylePrediction.squeeze()]);
|
const stylizedImage = await this.transformerModel.predict([loadedImage, stylePrediction.squeeze()]);
|
||||||
loadedImage.dispose();
|
loadedImage.dispose();
|
||||||
stylePrediction.dispose();
|
stylePrediction.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user