pip install ultralytics
yolo detect predict model=yolov8x.pt source="img.jpg" save=True
from ultralytics import YOLO
model = YOLO('yolov8x.pt')
results = model('img.jpg', save=True)
Example
yolo task=segment mode=predict model=yolov8x-seg.pt source='img.jpg' save=true
from ultralytics import YOLO
model = YOLO('yolov8x-seg.pt')
results = model('img.jpg', save=True)
Example
yolo detect predict model=yolov8x.pt source="video.mp4" save=True
from ultralytics import YOLO
model = YOLO('yolov8x.pt')
results = model('video.mp4', save=True)
Example
yolo task=segment mode=predict model=yolov8x-seg.pt source='video.mp4' save=true
from ultralytics import YOLO
model = YOLO('yolov8x-seg.pt')
results = model('video.mp4', save=True)
Example
yolo detect predict model=yolov8x.pt source=0 show=True
from ultralytics import YOLO
model = YOLO('yolov8x.pt')
model.predict(source="0", show=True)
Example
yolo task=segment mode=predict model=yolov8x-seg.pt source='0' show=True
from ultralytics import YOLO
model = YOLO('yolov8x-seg.pt')
model.predict(source="0", show=True)
Example