Files
yolov8-plate/export_onnx.py
we0091234 a921ffd3e7 yolov8
2024-02-28 13:20:13 +08:00

11 lines
522 B
Python

from ultralytics import YOLO
# Load a model
model = YOLO("yolov8n.yaml") # build a new model from scratch
model = YOLO("runs/detect/train2/weights/best.pt") # load a pretrained model (recommended for training)
# Use the model
# model.train(data="coco128.yaml", epochs=3) # train the model
# metrics = model.val() # evaluate model performance on the validation set
# results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
path = model.export(format="onnx") # export the model to ONNX format