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