jsr90 commited on
Commit
8b2a2d2
1 Parent(s): ee1524f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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
- image = gr.inputs.Image(source="upload")
18
- image_ = gr.inputs.Image(source="webcam")
 
 
 
 
 
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
- [image, image_],
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",