hashb commited on
Commit
1266117
1 Parent(s): 3a9166a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(img):
14
- img = Image.fromarray(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):