YOLOv8 may also be used directly in a Python environment, and accepts the same arguments as in the CLI example above: from ultralytics import YOLO # Load a model model = YOLO("yolov8n.yaml") # build a new model from scratch model = YOLO("yolov8n.pt") # load a pretrained model ...