-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_Interface.py
More file actions
30 lines (23 loc) · 845 Bytes
/
01_Interface.py
File metadata and controls
30 lines (23 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
def greet(name):
return "Hello " + name + "!"
def turn_grey(image):
import cv2
image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
return image
def file_path(input, name):
return input
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
# iface = gr.Interface(
# fn=greet,
# inputs=gr.Textbox(lines=5, placeholder="Name Here...", label="Name"),
# outputs=gr.Textbox(lines=2, placeholder="Output Here...", label="Output"),
# )
# iface = gr.Interface(fn=turn_grey, inputs="image", outputs="image")
# iface = gr.Interface(
# fn=turn_grey,
# inputs=gr.Image(label="Input"),
# outputs=gr.Image(label="Output"),
# )
iface = gr.Interface(fn=file_path, inputs=[gr.Audio(sources=["microphone"], type="filepath"), gr.Radio(choices=["A", "B"])], outputs="text")
iface.launch()