Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,14 +5,14 @@ import cv2
|
|
5 |
from ultralytics import YOLO
|
6 |
|
7 |
# Load the YOLOv8 model
|
8 |
-
model = YOLO('best.pt'
|
9 |
|
10 |
def detect_objects(image):
|
11 |
# Convert the input image to a format YOLO can work with
|
12 |
image = np.array(image)
|
13 |
|
14 |
# Perform detection
|
15 |
-
results = model(image)[0]
|
16 |
|
17 |
# Draw bounding boxes on the image
|
18 |
for box in results.boxes.data.cpu().numpy():
|
|
|
5 |
from ultralytics import YOLO
|
6 |
|
7 |
# Load the YOLOv8 model
|
8 |
+
model = YOLO('best.pt')
|
9 |
|
10 |
def detect_objects(image):
|
11 |
# Convert the input image to a format YOLO can work with
|
12 |
image = np.array(image)
|
13 |
|
14 |
# Perform detection
|
15 |
+
results = model(image,line_width=1)[0]
|
16 |
|
17 |
# Draw bounding boxes on the image
|
18 |
for box in results.boxes.data.cpu().numpy():
|