Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,18 @@ def gradio_wrapper(img):
|
|
14 |
return results.render()[0]
|
15 |
|
16 |
# Set up the Gradio image input component with the option to upload an image or use the webcam
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
# Create the Gradio interface with the gradio_wrapper function, the image input component, and an image output component
|
21 |
demo = gr.Interface(
|
22 |
gradio_wrapper,
|
23 |
-
|
24 |
'image',
|
25 |
live=True,
|
26 |
title="CiclopeIA",
|
|
|
14 |
return results.render()[0]
|
15 |
|
16 |
# Set up the Gradio image input component with the option to upload an image or use the webcam
|
17 |
+
s = gr.Radio(["upload", "webcam"], type="index")
|
18 |
+
|
19 |
+
if s == "upload":
|
20 |
+
image = gr.inputs.Image(source="upload")
|
21 |
+
else:
|
22 |
+
image = gr.inputs.Image(source="webcam")
|
23 |
+
|
24 |
|
25 |
# Create the Gradio interface with the gradio_wrapper function, the image input component, and an image output component
|
26 |
demo = gr.Interface(
|
27 |
gradio_wrapper,
|
28 |
+
image,
|
29 |
'image',
|
30 |
live=True,
|
31 |
title="CiclopeIA",
|