hashb commited on
Commit
d679bde
·
1 Parent(s): 73d3615

Update app.py

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