You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
628 B
Python

from ultralytics import YOLO
# Load a model
model = YOLO("/home/yaxin/wangying/fd/yolov8/ultralytics/ultralytics/cfg/models/v8/yolov8.yaml") # build a new model from scratch
model = YOLO("/home/yaxin/wangying/fd/yolov8/yolov8n.pt") # load a pretrained model (recommended for training)
# Use the model
model.train(data="/home/yaxin/wangying/fd/yolov8/person.yaml", epochs=1000) # 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