File size: 425 Bytes
2fa1b3d d425726 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from ultralytics import YOLO
# Load a pretrained YOLO model (recommended for training)
model = YOLO('yolov8l.pt')
results = model.train(data='path_to_data/data.yaml', epochs=3)
# Evaluate the model's performance on the validation set
results = model.val()
# Perform object detection on an image using the model
results = model('path_to_test_image')
# Export the model to ONNX format
success = model.export(format='onnx') |