cv_workshop_1 / train.py
kostya-cholak's picture
fix: add readme
076a567
raw
history blame contribute delete
389 Bytes
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)