博客
关于我
OpenCV与AI深度学习 | 基于YOLOv8 + BotSORT实现球员和足球检测与跟踪 (步骤 + 源码)
阅读量:792 次
发布时间:2023-02-23

本文共 2208 字,大约阅读时间需要 7 分钟。

??YOLOv8?BotSORT???????????

???????YOLOv8?BotSORT??????????????????????????????????


1. ????

YOLO?You Only Look Once??????????????????????????????????YOLOv1?2015??????????????????Ultralytics???????YOLO????????YOLOv8????????????????????????????????????????


2. YOLO????

YOLO???????????????????????????????????????????????????????????SxS?????????????????

  • ????????????0?1??????????????
  • xywh????????????????????????????
  • ???????????????????????????????????0?1???

3. ????

3.1 ??????????YOLOv8

  • ????????Roboflow?????????????????????????????config.yaml????
  • ???????Ultralytics????YOLO?????????
    pip install ultralytics
  • ???????
    • ?config.yaml???????????????????
    • ??????????????0: Ball?1: Player?2: Referee??
  • ???????YOLOv8??????????????????????YOLOv8n?Nano?????????????
  • ?????
    from ultralytics import YOLOmodel = YOLO('yolov8n.pt')results = model.train(data="config.yaml", epochs=50, patience=5)
  • ?????????????????????????????????best.pt??????

  • 3.2 ??????

  • ?????????????????mAP????????????????YOLOv8???????????????????640x640?????????
  • ?????
    • ?????????32???????1024x768?1088x1280??????????????????
    • ?????????????????????15x15???????????
  • ???????GIMP????????????????????????????????????

  • 3.3 ??????

  • ????????????????????????????YOLOv8???????????????????????
  • ????????mAP?recall??????precision?????????????????????
  • ?????????????Roboflow???????????????????

  • 3.4 ?????

  • ????????
    import cv2from ultralytics import YOLOmodel = YOLO('yolov8n.pt')
  • ???????BotSORT????????????????????????
    import cv2from ultralytics import YOLO# ????????model = YOLO('runs/detect/train2/weights/best.pt')# ??????video_path = r"path/to/video"cap = cv2.VideoCapture(video_path)while cap.isOpened():    success, frame = cap.read()    if success:        # ??YOLOv8??        results = model.track(frame, persist=True, show=True, tracker="botsort.yaml")        # ?????        annotated_frame = results[0].plot()        # ????        cv2.imshow("YOLOv8 Tracking", annotated_frame)        if cv2.waitKey(1) & 0xFF == ord("q"):            break    else:        breakcap.release()cv2.destroyAllWindows()
  • ???????????????????????????????BotSORT????????ID?????????????

  • 4. ??

    ????YOLOv8?BotSORT??????????????????????????????????????????????????????????????????????????????????????

    转载地址:http://ehsfk.baihongyu.com/

    你可能感兴趣的文章
    OC block声明和使用
    查看>>
    OC Xcode快捷键
    查看>>
    oc 中的.m和.mm文件区别
    查看>>
    OC 中的重写 OC中没有重载 以及隐藏
    查看>>
    OC 内存管理黄金法则
    查看>>
    oc57--Category 分类
    查看>>
    occi库在oracle官网的下载针对vs2008
    查看>>
    OceanBase 安装使用详细说明
    查看>>
    OceanBase详解及如何通过MySQL的lib库进行连接
    查看>>
    ocp最新题库之052新题带答案整理-36题
    查看>>
    OCP题库升级,新版的052考试题及答案整理-18
    查看>>
    OCR:文字识别(最详细教程)
    查看>>
    OCR使用总结
    查看>>
    Octotree Chrome插件离线安装
    查看>>
    OC中关于给NSString 赋 nil和@""的区别
    查看>>
    OC字符串方法汇总
    查看>>
    oday!POC管理和漏洞扫描小工具
    查看>>
    odoo14配置阿里云免费SSL证书
    查看>>
    ofbiz 定义
    查看>>
    Ofelia:在Pd中融合openFrameworks与Lua的创意编程利器
    查看>>