Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,20 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
|
|
5 |
waifu2x = pipeline("image-upscaling", model=model_name)
|
6 |
|
7 |
|
8 |
-
def
|
9 |
-
output_image = waifu2x(input_image)
|
10 |
return output_image
|
11 |
|
12 |
|
13 |
input_image = gr.inputs.Image(label="Input Image")
|
14 |
output_image = gr.outputs.Image(label="Enlarged Image", type="numpy")
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
|
5 |
+
model_name = "joeddav/xlnet-base-cased"
|
6 |
waifu2x = pipeline("image-upscaling", model=model_name)
|
7 |
|
8 |
|
9 |
+
def image_upscaler(input_image):
|
10 |
+
output_image = waifu2x(input_image)[0]['generated']
|
11 |
return output_image
|
12 |
|
13 |
|
14 |
input_image = gr.inputs.Image(label="Input Image")
|
15 |
output_image = gr.outputs.Image(label="Enlarged Image", type="numpy")
|
16 |
|
17 |
+
title = "Waifu2x Image Upscaler"
|
18 |
+
description = "This app uses the Hugging Face transformers library to upscale images using the Waifu2x model."
|
19 |
+
|
20 |
+
gr.Interface(fn=image_upscaler, inputs=input_image, outputs=output_image, title=title, description=description).launch()
|