Spaces:
Kyouka
/
Sleeping

Khrisna commited on
Commit
e8f973d
·
verified ·
1 Parent(s): 9c632f4

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -494,7 +494,7 @@ async function upscaleImage(imageBuffer) {
494
  return new Promise(async (resolve, reject) => {
495
  try {
496
  const upscaler = new Upscaler();
497
- const imageTensor = tf.tensor3d(imageBuffer, [imageBuffer.height, imageBuffer.width, 3]);
498
 
499
  const upscaledTensor = await upscaler.upscale(imageTensor, {
500
  scale: 4, // upscale by a factor of 4
@@ -504,7 +504,7 @@ async function upscaleImage(imageBuffer) {
504
  colorEnhance: true, // enhance colors
505
  });
506
 
507
- const upscaledImageBuffer = await tf.tensor3dToBuffer(upscaledTensor);
508
 
509
  // dispose the tensors!
510
  imageTensor.dispose();
 
494
  return new Promise(async (resolve, reject) => {
495
  try {
496
  const upscaler = new Upscaler();
497
+ const imageTensor = tfjs.tensor3d(imageBuffer, [imageBuffer.height, imageBuffer.width, 3]);
498
 
499
  const upscaledTensor = await upscaler.upscale(imageTensor, {
500
  scale: 4, // upscale by a factor of 4
 
504
  colorEnhance: true, // enhance colors
505
  });
506
 
507
+ const upscaledImageBuffer = await tfjs.tensor3dToBuffer(upscaledTensor);
508
 
509
  // dispose the tensors!
510
  imageTensor.dispose();