Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,8 @@ import cv2
|
|
| 2 |
import numpy as np
|
| 3 |
|
| 4 |
# Load the SSD model and configuration
|
| 5 |
-
model_path = '
|
| 6 |
-
config_path = '
|
| 7 |
|
| 8 |
# Load the class labels from the COCO dataset
|
| 9 |
CLASSES = [
|
|
@@ -21,7 +21,7 @@ CLASSES = [
|
|
| 21 |
]
|
| 22 |
|
| 23 |
# Initialize the OpenCV DNN network
|
| 24 |
-
net = cv2.dnn.
|
| 25 |
|
| 26 |
# Function to process the video frame and detect objects
|
| 27 |
def detect_objects_in_frame(frame):
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
|
| 4 |
# Load the SSD model and configuration
|
| 5 |
+
model_path = 'MobileNetSSD_deploy.caffemodel' # Path to the pre-trained SSD model
|
| 6 |
+
config_path = 'MobileNetSSD_deploy.prototxt.txt' # Path to the deploy prototxt file
|
| 7 |
|
| 8 |
# Load the class labels from the COCO dataset
|
| 9 |
CLASSES = [
|
|
|
|
| 21 |
]
|
| 22 |
|
| 23 |
# Initialize the OpenCV DNN network
|
| 24 |
+
net = cv2.dnn.readNetFromCaffe(config_path,model_path)
|
| 25 |
|
| 26 |
# Function to process the video frame and detect objects
|
| 27 |
def detect_objects_in_frame(frame):
|