Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Unable to visualize generated image #45

Open
adityarajsahu opened this issue May 14, 2024 · 0 comments
Open

Unable to visualize generated image #45

adityarajsahu opened this issue May 14, 2024 · 0 comments

Comments

@adityarajsahu
Copy link

adityarajsahu commented May 14, 2024

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))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant