practisebook commited on
Commit
13219fe
·
verified ·
1 Parent(s): 51fc398

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -11
app.py CHANGED
@@ -129,17 +129,6 @@ def process_frame(frame, audio_mode):
129
  if start_detection:
130
  st.success("Object detection started.")
131
  try:
132
- # Use the IP webcam URL as the video source
133
- cap = cv2.VideoCapture(ip_webcam_url)
134
- if not cap.isOpened():
135
- st.error("Could not connect to the IP Webcam stream. Check the URL and try again.")
136
- else:
137
- while not stop_detection:
138
- ret, frame = cap.read()
139
- if not ret:
140
- st.error("Failed to retrieve video frame. Exiting.")
141
- break
142
-
143
  detected_objects, processed_frame = process_frame(frame, audio_activation)
144
 
145
  frame_rgb = cv2.cvtColor(processed_frame, cv2.COLOR_BGR2RGB)
 
129
  if start_detection:
130
  st.success("Object detection started.")
131
  try:
 
 
 
 
 
 
 
 
 
 
 
132
  detected_objects, processed_frame = process_frame(frame, audio_activation)
133
 
134
  frame_rgb = cv2.cvtColor(processed_frame, cv2.COLOR_BGR2RGB)