google-research / maxim

[CVPR 2022 Oral] Official repository for "MAXIM: Multi-Axis MLP for Image Processing". SOTA for denoising, deblurring, deraining, dehazing, and enhancement.
https://arxiv.org/abs/2201.02973
Apache License 2.0
977 stars 105 forks source link

Unable to visualize generated image #45

Open adityarajsahu opened 2 months ago

adityarajsahu commented 2 months ago

How to visualise the deblurred image generated by google/maxim-s3-deblurring-realblur-r model ?

I tried this code from huggingface

from huggingface_hub import from_pretrained_keras from PIL import Image

import tensorflow as tf import numpy as np import requests

url = "https://github.com/sayakpaul/maxim-tf/raw/main/images/Deblurring/input/1fromGOPR0950.png" image = Image.open(requests.get(url, stream=True).raw) image = np.array(image) image = tf.convert_to_tensor(image) image = tf.image.resize(image, (256, 256))

model = from_pretrained_keras("google/maxim-s3-deblurring-realblur-r") predictions = model.predict(tf.expand_dims(image, 0))