YOLOv8
是发布YOLOv5
的组织发布的
https://github.com/ultralytics/yolov5
安装
pip install ultralytics
使用预训练的模型(会自动下载)
预训练模型分为10档
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
预测
inputs = [img, img] # list of np arrays
results = model(inputs) # List of Results objects
for result in results:
boxes = result.boxes # Boxes object for bbox outputs
masks = result.masks # Masks object for segmenation masks outputs
probs = result.probs # Class probabilities for classification outputs
...
中文readme:https://github.com/ultralytics/yolov5/blob/master/README.zh-CN.md