File size: 470 Bytes
4bc11f8
7ddca97
 
4bc11f8
7ddca97
4bc11f8
 
7ddca97
4bc11f8
 
 
 
7ddca97
 
4bc11f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# app.py (Versi Fix)

import gradio as gr
from super_image import EdsrModel, ImageLoader

# Load model dari Hugging Face
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=2)

def enhance_image(image):
    inputs = ImageLoader.load_image(image).unsqueeze(0)
    preds = model(inputs)
    output_image = ImageLoader.save_image(preds)
    return output_image

gr.Interface(fn=enhance_image, inputs=gr.Image(type="pil"), outputs=gr.Image(type="pil")).launch()