Update app.py
Browse files
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 |
|