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