|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
|
|
model_name = "joeddav/xlnet-base-cased" |
|
waifu2x = pipeline("image-upscaling", model=model_name) |
|
|
|
|
|
def image_upscaler(input_image): |
|
output_image = waifu2x(input_image)[0]['generated'] |
|
return output_image |
|
|
|
|
|
input_image = gr.inputs.Image(label="Input Image") |
|
output_image = gr.outputs.Image(label="Enlarged Image", type="numpy") |
|
|
|
title = "Waifu2x Image Upscaler" |
|
description = "This app uses the Hugging Face transformers library to upscale images using the Waifu2x model." |
|
|
|
gr.Interface(fn=image_upscaler, inputs=input_image, outputs=output_image, title=title, description=description).launch() |
|
|