位置: IT常识 - 正文

YOLOv5 + StrongSORT with OSNet

编辑:rootadmin
YOLOv5 + StrongSORT with OSNet 项目简介YOLOv5 + StrongSORT with OSNet:YOLOv5检测器 + StrongSORT跟踪算法 + OSNet行人重识别模型项目地址:https://github.com/mikel-brostrom/Yolov5_StrongSORT_OSNet环境安装

推荐整理分享YOLOv5 + StrongSORT with OSNet,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

1.Conda建立虚拟环境

conda create -n yolov5 python=3.8

2.安装PyTroch和TorchVision

可以选择官网安装:或者下载whl文件

本文Pytorch安装的版本为1.8.0,torchvision对应的版本为0.9.0

注意:cp对应Python包版本,linux对应lLinux版本,win对应Windows版本

当whl文件下载到本地后,进入包下载命令,使用pip install 包名来安装:

pip install torch-1.8.0+cu111-cp38-cp38-win_amd64.whlpip install torchvision-0.9.0+cu111-cp38-cp38-win_amd64.whl

3.安装Torchreid

# cd to your preferred directory and clone this repogit clone https://github.com/KaiyangZhou/deep-person-reid.git# create environmentcd deep-person-reid/# 环境上面已建立,使用yolov5虚拟环境# conda create --name torchreid python=3.7# conda activate torchreid# install dependencies# make sure `which python` and `which pip` point to the correct pathpip install -r requirements.txt# install torch and torchvision (select the proper cuda version to suit your machine)# conda install pytorch torchvision cudatoolkit=9.0 -c pytorch# install torchreid (don't need to re-build it if you modify the source code)python setup.py develop

pip install -r requirements.txt本地安装记录:

最后执行python setup.py develop,一顿操作后得到下面的提示:

YOLOv5 + StrongSORT with OSNet

输入conda list确定本机基本环境:

python:3.8pytorch:1.8.0torchvision:0.9.0torchreid:1.4.0注:本环境下的一些包安装这个是没有的,这些是之前安装另一个项目留下的(主要是一些导出包)

4.安装项目其他依赖包

Bug解决

问题描述:在下载源码是选择Download Zip这种方式,默认yolov5文件夹下内容是空的,此时需要点击编号(yolov5@91a81d4)下载yolov5源码放在yolov5目录下

但在我运行python track.py 时程序依然报错:

这是因为在strong_sort/deep/reid目录是空的,下载源码默认是没下载那部分内容的,因此需要和上面一下,将torchreid下载并放入到strong_sort/deep/reid下面

代码运行

python track.py

默认结果保存在runs/track/exp目录下,之前跑过一次没成功,所以这次结果保存在runs/track/exp2目录下如果使用python track.py运行的话默认是不保存视频的,只能在控制台查看输出结果,如果保存视频,需指定–save-vid参数,使用命令python track.py --save-vid即可参数解析

track.py

parser.add_argument('--yolo-weights', nargs='+', type=Path, default=WEIGHTS / 'yolov5m.pt', help='model.pt path(s)') parser.add_argument('--strong-sort-weights', type=Path, default=WEIGHTS / 'osnet_x0_25_msmt17.pt') parser.add_argument('--config-strongsort', type=str, default='strong_sort/configs/strong_sort.yaml') parser.add_argument('--source', type=str, default='D:/video/1.6_10_videos/301337_3/151035.mp4', help='file/dir/URL/glob, 0 for webcam') parser.add_argument('--imgsz', '--img', '--img-size', nargs='+', type=int, default=[640], help='inference size h,w') parser.add_argument('--conf-thres', type=float, default=0.5, help='confidence threshold') parser.add_argument('--iou-thres', type=float, default=0.5, help='NMS IoU threshold') parser.add_argument('--max-det', type=int, default=1000, help='maximum detections per image') parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu') parser.add_argument('--show-vid', action='store_true', help='display tracking video results') parser.add_argument('--save-txt', action='store_true', help='save results to *.txt') parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels') parser.add_argument('--save-crop', action='store_true', help='save cropped prediction boxes') parser.add_argument('--save-vid', action='store_true', help='save video tracking results') parser.add_argument('--nosave', action='store_true', help='do not save images/videos') # class 0 is person, 1 is bycicle, 2 is car... 79 is oven parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --classes 0, or --classes 0 2 3') parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS') parser.add_argument('--augment', action='store_true', help='augmented inference') parser.add_argument('--visualize', action='store_true', help='visualize features') parser.add_argument('--update', action='store_true', help='update all models') parser.add_argument('--project', default=ROOT / 'runs/track', help='save results to project/name') parser.add_argument('--name', default='exp', help='save results to project/name') parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment') parser.add_argument('--line-thickness', default=3, type=int, help='bounding box thickness (pixels)') parser.add_argument('--hide-labels', default=False, action='store_true', help='hide labels') parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences') parser.add_argument('--hide-class', default=False, action='store_true', help='hide IDs') parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference') parser.add_argument('--dnn', action='store_true', help='use OpenCV DNN for ONNX inference') parser.add_argument('--eval', action='store_true', help='run evaluation')–yolo-weights:YOLO得到的权重模型–strong-sort-weights:Reid模型–show-vid:python track.py --show-vid:可视化跟踪结果–save-vid:python track.py --save-vid:保存跟踪结果–classes:指定类别检测跟踪彩蛋

本文对构建YOLOAir库环境进行详细阐述,笔者以后会定期分享关于项目的其他模块和相关技术,笔者也建立了一个关于目标检测的交流群:781334731,欢迎大家踊跃加入,一起学习鸭!

笔者也持续更新一个微信公众号:Nuist计算机视觉与模式识别,大家帮忙点个关注谢谢

本文链接地址:https://www.jiuchutong.com/zhishi/298657.html 转载请保留说明!

上一篇:SQL Server详细使用教程(包含启动SQL server服务、建立数据库、建表的详细操作) 非常适合初学者(sql server2016使用)

下一篇:Vue基础教程(下篇)(vue基础知识)

  • 企业增值税税负率怎么计算
  • 什么是非居民纳税人类别
  • 研发费用加计扣除是什么意思啊
  • 生产设备改扩建会计分录
  • 银行转账记录能保存多久
  • 税率变更后账务怎么处理
  • 进项税额转出影响城建税吗
  • 员工交通费补贴标准
  • 境外公司委托境内公司付款
  • 电子发票与纸质发票具有同等效力
  • 开票系统年费怎么缴纳
  • 保函保证金怎么审计
  • 公司股东可以自己买保险吗
  • 房租本月入账上月的怎么摊销?
  • 法人的往来款可以转为实收资本吗?
  • 个体户办营业执照需要什么证件和材料
  • 购买户外用品的app
  • 通用机打发票什么样子
  • 以前工会是没有公章的吗
  • 记账凭证应交税费应交增值税怎么写
  • 赔偿款和罚款是一样的吗
  • 房地产开发劳务合同范本
  • 代收代缴水电费能开发票吗
  • 资产评估入账的评估报告
  • 公司注销清算企业所得税申报表怎么填
  • 加速折旧法和直线折旧法的区别
  • 转账和电汇哪个便宜
  • 维修机器设备买什么好
  • 小规模企业年末怎么结转
  • 如何保护word文件不被他人修改
  • 方正书版10.0教程
  • 顺流交易合并抵消 chenyiwei
  • phpdie
  • timit数据集
  • 前端常问的面试题
  • css实现轮播图侧边阴影效果
  • 前端html模板
  • ps命令显示进程状态
  • 矿产资源补偿费是什么
  • 利息收入可以冲减开发成本的法律依据
  • 企业的借款费用怎么入账
  • 一个例子解释唯物辩证法三大规律
  • 帝国cms8.0
  • Servlet4.0 Response
  • 出差补贴要不要交个税呢?
  • 个体户办营业执照网上怎么申请
  • 企业资金如何运动
  • 认缴资金可以增加吗
  • 发票丢失了可以用复印件加盖发票章入账吗
  • 行政单位年结
  • 收到的普通发票被对方作废
  • 根据企业会计准则第11号规定,下列关于等待期
  • xp系统桌面在c盘哪个位置
  • suse 10.3 安装http apche2时遇到的rpm依赖问题的解决方法
  • centos怎么查看文件
  • win1共享
  • mac下使用8086汇编
  • win7系统怎么禁用数字签名
  • Win10 Mobile RS2预览版14905更新内容大全:全新精致铃声
  • linux系统怎么查看root用户密码
  • window10显示重启提示
  • 原生js实现promise.all
  • js数组操作函数
  • jquery教程w3c
  • js选择框全选
  • nodejs为什么性能这么好
  • unity怎么新建项目
  • 安卓手机怎么导入地图
  • ShareSdk实现第三方分享功能
  • Python实现Sqlite将字段当做索引进行查询的方法
  • JavaScript的Number对象的toString()方法
  • jquery插件开发方法
  • javascript define的用法
  • js构造器constructor
  • 南京市国家税务局
  • 邮政银行开税票要什么材料
  • 支付宝申领失业金申请审核多久
  • 江苏地税局官网网站
  • 伊川娘娘山传说
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设