mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-27 02:30:17 +08:00
23 lines
489 B
Python
23 lines
489 B
Python
# Demo: (Image) -> (Image)
|
|
|
|
import gradio as gr
|
|
|
|
def detect(image):
|
|
# return image
|
|
return (image, [("sign", 210, 80, 280, 150), ("train", 100, 100, 180, 150)])
|
|
|
|
|
|
iface = gr.Interface(detect,
|
|
gr.inputs.Image(type="pil"),
|
|
# "image",
|
|
"segmented_image",
|
|
examples=[
|
|
["images/stop_1.jpg"],
|
|
["images/stop_2.jpg"],
|
|
])
|
|
|
|
iface.test_launch()
|
|
|
|
if __name__ == "__main__":
|
|
iface.launch()
|