Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)
|