demo_shitu/1.py
2024-09-09 23:09:20 +08:00

11 lines
248 B
Python

from ultralytics import YOLO
# Load a pre-trained YOLOv10n model
model = YOLO("./yolov10x.pt")
model.train(data="./dataset.yaml", epochs=3)
# Perform object detection on an image
results = model("./1.jpg")
# Display the results
results[0].show()