File size: 389 Bytes
076a567
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from ultralytics import YOLO

# Load a model
model = YOLO("yolov8n.pt")

# Train the model
results = model.train(
    data="./datasets/socker/socker.yaml",
    epochs=10,
    imgsz=1920
)
# evaluate model performance on the validation set
metrics = model.val()
print(metrics)

# save the model
model.save("my_model.pt")  

# Export the model
path = model.export(format="onnx")
print(path)