Spaces:
Runtime error
Runtime error
Edvin Behdadijd
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,20 +7,14 @@ from ultralytics import YOLO
|
|
| 7 |
# Load the YOLOv8 model
|
| 8 |
model = YOLO('best.pt')
|
| 9 |
|
| 10 |
-
# Define a list of colors for
|
| 11 |
colors = [
|
| 12 |
(255, 0, 0), # Red
|
| 13 |
(0, 255, 0), # Green
|
| 14 |
(0, 0, 255), # Blue
|
| 15 |
(255, 255, 0), # Cyan
|
| 16 |
(255, 0, 255), # Magenta
|
| 17 |
-
(0, 255, 255)
|
| 18 |
-
(128, 0, 0), # Maroon
|
| 19 |
-
(0, 128, 0), # Olive
|
| 20 |
-
(128, 128, 0), # Teal
|
| 21 |
-
(0, 0, 128), # Navy
|
| 22 |
-
(128, 0, 128), # Purple
|
| 23 |
-
(0, 128, 128) # Aqua
|
| 24 |
]
|
| 25 |
|
| 26 |
def detect_objects(image):
|
|
|
|
| 7 |
# Load the YOLOv8 model
|
| 8 |
model = YOLO('best.pt')
|
| 9 |
|
| 10 |
+
# Define a list of colors for the 6 classes
|
| 11 |
colors = [
|
| 12 |
(255, 0, 0), # Red
|
| 13 |
(0, 255, 0), # Green
|
| 14 |
(0, 0, 255), # Blue
|
| 15 |
(255, 255, 0), # Cyan
|
| 16 |
(255, 0, 255), # Magenta
|
| 17 |
+
(0, 255, 255) # Yellow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
]
|
| 19 |
|
| 20 |
def detect_objects(image):
|