Spaces:
Build error
Build error
Commit
·
736ef53
1
Parent(s):
2b8f883
fix: change bounding box color
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ import cv2
|
|
| 10 |
model_path = hf_hub_download(repo_id='ethandavey/yoloV5-coursework-model', filename='model.pt')
|
| 11 |
|
| 12 |
# Load the YOLOv5 model
|
| 13 |
-
model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path)
|
| 14 |
model.line_thickness = 3 # Set the thickness of the bounding box lines
|
| 15 |
|
| 16 |
# Print model class names
|
|
@@ -44,7 +44,7 @@ def detect(image):
|
|
| 44 |
image_np,
|
| 45 |
(xyxy[0], xyxy[1]),
|
| 46 |
(xyxy[2], xyxy[3]),
|
| 47 |
-
color=(
|
| 48 |
thickness=model.line_thickness,
|
| 49 |
lineType=cv2.LINE_AA,
|
| 50 |
)
|
|
|
|
| 10 |
model_path = hf_hub_download(repo_id='ethandavey/yoloV5-coursework-model', filename='model.pt')
|
| 11 |
|
| 12 |
# Load the YOLOv5 model
|
| 13 |
+
model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path, source='github')
|
| 14 |
model.line_thickness = 3 # Set the thickness of the bounding box lines
|
| 15 |
|
| 16 |
# Print model class names
|
|
|
|
| 44 |
image_np,
|
| 45 |
(xyxy[0], xyxy[1]),
|
| 46 |
(xyxy[2], xyxy[3]),
|
| 47 |
+
color=(255, 0, 0),
|
| 48 |
thickness=model.line_thickness,
|
| 49 |
lineType=cv2.LINE_AA,
|
| 50 |
)
|