Spaces:
Running
Running
yizhangliu
commited on
Commit
·
99108df
1
Parent(s):
7942d31
Update app.py
Browse files
app.py
CHANGED
@@ -291,7 +291,8 @@ image_blocks.launch(inline=True)
|
|
291 |
import gradio as gr
|
292 |
'''
|
293 |
|
294 |
-
def greet(
|
|
|
295 |
target_size = (image.shape[0], image.shape[1])
|
296 |
print(f'liuyz_1_', target_size)
|
297 |
salutation = "Good morning" if is_morning else "Good evening"
|
@@ -299,10 +300,12 @@ def greet(image, name, is_morning, temperature):
|
|
299 |
celsius = (temperature - 32) * 5 / 9
|
300 |
return image, greeting, round(celsius, 2)
|
301 |
|
|
|
|
|
302 |
demo = gr.Interface(
|
303 |
fn=greet,
|
304 |
-
inputs=[
|
305 |
-
outputs=[
|
306 |
)
|
307 |
demo.launch()
|
308 |
|
|
|
291 |
import gradio as gr
|
292 |
'''
|
293 |
|
294 |
+
def greet(dict, name, is_morning, temperature):
|
295 |
+
image = dict['image']
|
296 |
target_size = (image.shape[0], image.shape[1])
|
297 |
print(f'liuyz_1_', target_size)
|
298 |
salutation = "Good morning" if is_morning else "Good evening"
|
|
|
300 |
celsius = (temperature - 32) * 5 / 9
|
301 |
return image, greeting, round(celsius, 2)
|
302 |
|
303 |
+
image = gr.Image(source='upload', tool='sketch', type="pil", label="Upload")# .style(height=400)
|
304 |
+
|
305 |
demo = gr.Interface(
|
306 |
fn=greet,
|
307 |
+
inputs=[image, "text", "checkbox", gr.Slider(0, 100)],
|
308 |
+
outputs=['image', "text", "number"],
|
309 |
)
|
310 |
demo.launch()
|
311 |
|