Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -504,8 +504,9 @@ async function upscaleImage(images) {
|
|
| 504 |
colorEnhance: true, // enhance colors
|
| 505 |
});
|
| 506 |
|
| 507 |
-
const upscaledTensor = await tfjs.node.encodePng(tensor)
|
| 508 |
-
const
|
|
|
|
| 509 |
|
| 510 |
// dispose the tensors!
|
| 511 |
image.dispose();
|
|
|
|
| 504 |
colorEnhance: true, // enhance colors
|
| 505 |
});
|
| 506 |
|
| 507 |
+
const upscaledTensor = await tfjs.node.encodePng(tensor)
|
| 508 |
+
const typedArray = await upscaledTensor.data();
|
| 509 |
+
const arrayBuffer = Buffer.from(typedArray);
|
| 510 |
|
| 511 |
// dispose the tensors!
|
| 512 |
image.dispose();
|