forked from scott/YOLOv8_test_example
parse image path from argument
This commit is contained in:
1 parent
a9a3f2142b
commit
7df0ad92ae
1 file changed
+7
-1
@@ -1,10 +1,16 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
from ultralytics import YOLO
|
from ultralytics import YOLO
|
||||||
|
|
||||||
|
image_path = sys.argv[1]
|
||||||
|
|
||||||
# Load the small pretrained YOLOv8 object-detection model.
|
# Load the small pretrained YOLOv8 object-detection model.
|
||||||
model = YOLO("yolov8n.pt")
|
model = YOLO("yolov8n.pt")
|
||||||
|
|
||||||
# Run object detection on a test image.
|
# Run object detection on a test image.
|
||||||
results = model("bus4.jpg")
|
results = model(image_path)
|
||||||
|
|
||||||
has_bus = False
|
has_bus = False
|
||||||
max_confidence = 0.0
|
max_confidence = 0.0
|
||||||
|
|||||||
Reference in new issue
Block a user