Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -12,9 +12,9 @@ model = cv2.dnn_DetectionModel(net)
|
|
12 |
model.setInputParams(scale=1 / 255, size=(416, 416), swapRB=True)
|
13 |
|
14 |
def detect(image):
|
15 |
-
|
16 |
#img = cv2.cvtColor(np.array(img), cv2.COLOR_BGR2RGB)
|
17 |
-
img = cv2.
|
18 |
classIds, scores, boxes = model.detect(img, confThreshold=0.6, nmsThreshold=0.4)
|
19 |
|
20 |
for (classId, score, box) in zip(classIds, scores, boxes):
|
|
|
12 |
model.setInputParams(scale=1 / 255, size=(416, 416), swapRB=True)
|
13 |
|
14 |
def detect(image):
|
15 |
+
img = Image.fromarray(image)
|
16 |
#img = cv2.cvtColor(np.array(img), cv2.COLOR_BGR2RGB)
|
17 |
+
img = cv2.imread(np.array(img))
|
18 |
classIds, scores, boxes = model.detect(img, confThreshold=0.6, nmsThreshold=0.4)
|
19 |
|
20 |
for (classId, score, box) in zip(classIds, scores, boxes):
|