practisebook commited on
Commit
61bab8b
·
verified ·
1 Parent(s): 04a2bd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -2,7 +2,6 @@ import os
2
  import gradio as gr
3
  from ultralytics import YOLO
4
  import cv2
5
- from datetime import datetime
6
 
7
  # Load YOLOv8 model
8
  model = YOLO("yolov8n.pt")
@@ -26,8 +25,8 @@ with gr.Blocks() as demo:
26
  gr.Markdown("# Real-Time Object Detection for Blind Assistance")
27
  gr.Markdown("This app detects objects in real-time using your webcam.")
28
 
29
- # Use gr.Video for webcam input
30
- video_input = gr.Video(source="webcam", label="Webcam Stream")
31
  output_gallery = gr.Video(label="Detection Output")
32
 
33
  detect_button = gr.Button("Start Detection")
 
2
  import gradio as gr
3
  from ultralytics import YOLO
4
  import cv2
 
5
 
6
  # Load YOLOv8 model
7
  model = YOLO("yolov8n.pt")
 
25
  gr.Markdown("# Real-Time Object Detection for Blind Assistance")
26
  gr.Markdown("This app detects objects in real-time using your webcam.")
27
 
28
+ # Remove the `source` argument
29
+ video_input = gr.Video(label="Webcam Stream", type="filepath")
30
  output_gallery = gr.Video(label="Detection Output")
31
 
32
  detect_button = gr.Button("Start Detection")