from ultralytics import YOLO # Load pretrained YOLOv8x-seg model (auto-downloads if missing) model = YOLO("yolov8x-seg.pt")