TShopping

標題: Yolov8 Models 測試 [打印本頁]

作者: woff    時間: 2023-9-28 18:19
標題: Yolov8 Models 測試
官方文件鏈結 https://docs.ultralytics.com/models/

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

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

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

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

  11.     # Run inference with the YOLOv8n model on the 'bus.jpg' image
  12.     results = model('bus.jpg')
複製代碼


原始圖片


結果圖:


文章出處:NetYea 網頁設計





歡迎光臨 TShopping (http://www.tshopping.com.tw/) Powered by Discuz! X3.2