Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ net = cv2.dnn.readNetFromDarknet('yolov4.cfg', 'yolov4.weights')
|
|
10 |
model = cv2.dnn_DetectionModel(net)
|
11 |
model.setInputParams(scale=1 / 255, size=(416, 416), swapRB=True)
|
12 |
|
13 |
-
def detect(
|
14 |
-
img =
|
15 |
classIds, scores, boxes = model.detect(img, confThreshold=0.6, nmsThreshold=0.4)
|
16 |
|
17 |
for (classId, score, box) in zip(classIds, scores, boxes):
|
|
|
10 |
model = cv2.dnn_DetectionModel(net)
|
11 |
model.setInputParams(scale=1 / 255, size=(416, 416), swapRB=True)
|
12 |
|
13 |
+
def detect(image):
|
14 |
+
img = cv2.imread(image)
|
15 |
classIds, scores, boxes = model.detect(img, confThreshold=0.6, nmsThreshold=0.4)
|
16 |
|
17 |
for (classId, score, box) in zip(classIds, scores, boxes):
|