JefferyJapheth commited on
Commit
bd4424b
1 Parent(s): 2165cdc

specifying the webcam source explicitly by passing the webcam ID as an argument to the gr.Interface function.

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -241,10 +241,11 @@ with mp_holistic.Holistic(min_detection_confidence=0.5, min_tracking_confidence=
241
 
242
  # Define the Gradio interface
243
  iface = gr.Interface(
244
- fn=predict_with_webcam, # The function to use for prediction
245
- inputs="webcam", # Use Gradio's "webcam" input to capture frames from the webcam
246
- outputs=gr.outputs.Textbox() # Display the prediction as text
247
- )
 
248
 
249
  # Launch the interface
250
  iface.launch()
 
241
 
242
  # Define the Gradio interface
243
  iface = gr.Interface(
244
+ fn=predict_with_webcam,
245
+ inputs=gr.inputs.Image(shape=(None, None, 3), source="webcam", tool="opencv"),
246
+ outputs=gr.outputs.Textbox()
247
+ )
248
+
249
 
250
  # Launch the interface
251
  iface.launch()