Abdullah104 commited on
Commit
0616595
·
verified ·
1 Parent(s): 7f20533

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -15,6 +15,7 @@ model = YOLO("best.pt")
15
 
16
  def detect(image):
17
  results = model.predict(image,iou = 0.3, conf = 0.1)
 
18
  result_img_rgb = cv2.cvtColor(result_img, cv2.COLOR_BGR2RGB) # convert to RGB
19
  return Image.fromarray(result_img_rgb)
20
 
 
15
 
16
  def detect(image):
17
  results = model.predict(image,iou = 0.3, conf = 0.1)
18
+ result_img = results[0].plot() # BGR image (numpy array)
19
  result_img_rgb = cv2.cvtColor(result_img, cv2.COLOR_BGR2RGB) # convert to RGB
20
  return Image.fromarray(result_img_rgb)
21