Maxim-Denoise / app.py
jintany's picture
Create app.py
a12f4f9
raw
history blame contribute delete
499 Bytes
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/Denoising/input/0011_23.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-denoising-sidd")
predictions = model.predict(tf.expand_dims(image, 0))