Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
import tempfile
|
3 |
from gradio_client import Client, handle_file
|
4 |
|
5 |
def upscale_image(image):
|
6 |
-
with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as temp_file:
|
7 |
-
image.save(temp_file.name)
|
8 |
client = Client("doevent/Face-Real-ESRGAN")
|
9 |
result = client.predict(
|
10 |
image=handle_file(image), # Directly pass the image
|
@@ -16,7 +13,7 @@ def upscale_image(image):
|
|
16 |
|
17 |
|
18 |
app = gr.Interface(upscale_image,
|
19 |
-
inputs = [gr.Image(label="Upload Image", type="
|
20 |
outputs = [gr.Image(label="Upscaled Image")])
|
21 |
|
22 |
app.launch(debug=True)
|
|
|
1 |
import gradio as gr
|
|
|
2 |
from gradio_client import Client, handle_file
|
3 |
|
4 |
def upscale_image(image):
|
|
|
|
|
5 |
client = Client("doevent/Face-Real-ESRGAN")
|
6 |
result = client.predict(
|
7 |
image=handle_file(image), # Directly pass the image
|
|
|
13 |
|
14 |
|
15 |
app = gr.Interface(upscale_image,
|
16 |
+
inputs = [gr.Image(label="Upload Image", type="filepath")],
|
17 |
outputs = [gr.Image(label="Upscaled Image")])
|
18 |
|
19 |
app.launch(debug=True)
|