skiAI/main.py

21 lines
609 B
Python

from ultralytics import YOLO
# Create a new YOLO model from scratch
#model = YOLO("yolo11n.yaml")
# Load a pretrained YOLO model (recommended for training)
model = YOLO("yolo11n-pose.pt")
# Train the model using the 'coco8.yaml' dataset for 3 epochs
results = model.train(data="datasets/skier_pose/skier_pose.yaml", epochs=200, imgsz=640, device='mps')
# Evaluate the model's performance on the validation set
results = model.val()
# Perform object detection on an image using the model
#results = model("bus.jpg", device='cpu')
# Export the model to ONNX format
#success = model.export(format="onnx")