woff 發表於 2023-9-28 18:19:54

Yolov8 Models 測試

官方文件鏈結 https://docs.ultralytics.com/models/

程式碼
from ultralytics import YOLO
import os
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"

if __name__ == '__main__':
    # Load a COCO-pretrained YOLOv8n model
    model = YOLO('yolov8n.pt')

    # Display model information (optional)
    model.info()

    # Train the model on the COCO8 example dataset for 100 epochs
    results = model.train(data='coco8.yaml', epochs=100, imgsz=640)

    # Run inference with the YOLOv8n model on the 'bus.jpg' image
    results = model('bus.jpg')

原始圖片


結果圖:


文章出處:NetYea 網頁設計
頁: [1]
查看完整版本: Yolov8 Models 測試