I want to use some image processing tensorflow.js model to an image. For this I have to convert this image to a tensor and pass it to the model.predict() function. This results me an output tensor. Now how to convert this predicted output tensor back to my output image.
const img = new Image();
img.src = inputImage.src;
img.onload = async () => {
const tensor = tf.browser.fromPixels(img).expandDims(0);
const prediction = model.predict(tensor.cast("float32")).squeeze();
}
Now How to convert this prediction tensor back into my output image?