from ultralytics import YOLO
import multiprocessing
# Load a model
model = YOLO("yolov8n.yaml") # build a new model from scratch
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
if __name__ == '__main__':
multiprocessing.freeze_support()
# Use the model
results = model.train(data="coco128.yaml", epochs=3) # train the model
results = model.val() # evaluate model performance on the validation set
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
success = YOLO("yolov8n.pt").export(format="onnx") # export a model to ONNX format
yolo v8给出的测试代码出现问题的解法(Windows)
最新推荐文章于 2024-05-21 22:44:12 发布