Spaces:
Sleeping
Sleeping
| 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) | |