Lasion commited on
Commit
3ef32da
1 Parent(s): 8fe8be0
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,11 +1,14 @@
1
  import gradio as gr
 
2
  from ultralytics import YOLO
3
 
4
  def run(source):
5
  global model
6
  res = model(source, conf=.5, iou=.5)
7
  res_plotted = res[0].plot()
8
- return res_plotted
 
 
9
 
10
  model = YOLO("yolov8n-nckh2023.pt") # Select YOLO model
11
 
 
1
  import gradio as gr
2
+ import cv2
3
  from ultralytics import YOLO
4
 
5
  def run(source):
6
  global model
7
  res = model(source, conf=.5, iou=.5)
8
  res_plotted = res[0].plot()
9
+ # converting BGR to RGB
10
+ result = cv2.cvtColor(res_plotted, cv2.COLOR_BGR2RGB)
11
+ return result
12
 
13
  model = YOLO("yolov8n-nckh2023.pt") # Select YOLO model
14