YOLOv5-DeepSORT-TensorRT 项目使用教程

YOLOv5-DeepSORT-TensorRT 项目使用教程

yolov5-deepsort-tensorrtA c++ implementation of yolov5 and deepsort项目地址:https://gitcode.com/gh_mirrors/yo/yolov5-deepsort-tensorrt

1. 项目的目录结构及介绍

yolov5-deepsort-tensorrt/
├── README.md
├── requirements.txt
├── demo_trt.py
├── config/
│   ├── default.yaml
│   └── ...
├── src/
│   ├── yolov5/
│   │   ├── yolov5.cpp
│   │   └── ...
│   ├── deepsort/
│   │   ├── deepsort.cpp
│   │   └── ...
│   └── ...
├── weights/
│   ├── yolov5s.wts
│   └── ...
└── ...
  • README.md: 项目说明文档。
  • requirements.txt: 项目依赖文件。
  • demo_trt.py: 项目启动文件。
  • config/: 配置文件目录。
  • src/: 源代码目录,包含 YOLOv5 和 DeepSORT 的实现。
  • weights/: 模型权重文件目录。

2. 项目的启动文件介绍

demo_trt.py

这是项目的主要启动文件,用于运行 YOLOv5 和 DeepSORT 的 TensorRT 引擎。

import sys
import os
from src.yolov5 import YOLOv5
from src.deepsort import DeepSORT

def main():
    # 加载配置
    config_path = "config/default.yaml"
    # 初始化 YOLOv5 和 DeepSORT
    yolov5 = YOLOv5(config_path)
    deepsort = DeepSORT(config_path)
    # 运行检测和跟踪
    yolov5.run()
    deepsort.run()

if __name__ == "__main__":
    main()

3. 项目的配置文件介绍

config/default.yaml

这是项目的默认配置文件,包含了 YOLOv5 和 DeepSORT 的参数设置。

yolov5:
  weights: "weights/yolov5s.wts"
  engine: "weights/yolov5s.engine"
  input_size: [640, 640]
  conf_thres: 0.5
  iou_thres: 0.5

deepsort:
  model_path: "weights/deepsort.engine"
  max_dist: 0.2
  min_confidence: 0.3
  nms_max_overlap: 1.0
  max_iou_distance: 0.7
  max_age: 70
  n_init: 3
  nn_budget: 100
  • yolov5: YOLOv5 相关配置。
    • weights: YOLOv5 权重文件路径。
    • engine: YOLOv5 TensorRT 引擎文件路径。
    • input_size: 输入图像尺寸。
    • conf_thres: 置信度阈值。
    • iou_thres: IOU 阈值。
  • deepsort: DeepSORT 相关配置。
    • model_path: DeepSORT TensorRT 引擎文件路径。
    • max_dist: 最大距离。
    • min_confidence: 最小置信度。
    • nms_max_overlap: NMS 最大重叠。
    • max_iou_distance: 最大 IOU 距离。
    • max_age: 最大年龄。
    • n_init: 初始化次数。
    • nn_budget: NN 预算。

yolov5-deepsort-tensorrtA c++ implementation of yolov5 and deepsort项目地址:https://gitcode.com/gh_mirrors/yo/yolov5-deepsort-tensorrt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

董瑾红William

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值