throwaway74 commited on
Commit
ffacfa9
·
verified ·
1 Parent(s): 91fa6f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -1,7 +1,24 @@
1
  import gradio as gr
 
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import spaces
3
+ from PIL import Image
4
+ import numpy as np
5
 
6
+ @spaces.GPU
7
+ def upscale(image):
8
+ img = Image.fromarray(image)
9
 
10
+ img = img.resize(
11
+ (img.width * 2, img.height * 2),
12
+ Image.LANCZOS
13
+ )
14
+
15
+ return np.array(img)
16
+
17
+ demo = gr.Interface(
18
+ fn=upscale,
19
+ inputs=gr.Image(type="numpy"),
20
+ outputs=gr.Image(type="numpy"),
21
+ title="Upscale Alpha Test"
22
+ )
23
+
24
+ demo.launch()