位置: 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正式启用
  • 房地产开发公司排名
  • 哪些行业不能开具增值税专用发票
  • 航天信息服务费不交可以吗
  • 开票系统技术服务费在申报表哪里抵扣
  • 通行费发票勾选认证有多少就可以抵扣多少吗
  • 企业资产重组是不定期清查吗
  • 金蝶专业版怎么导入备份账套
  • 发票不附销货清单可以吗
  • 企业公益金账务的会计处理怎么做
  • 银行多扣钱可以多倍赔偿吗
  • 预收装修款并开发票如何转成本?
  • 入库出库模板
  • 报关单上金额要和合同上一样吗
  • 农村合作社开具的专用发票免税吗
  • 租赁合同印花税税率2023
  • 税收编码3040203
  • 只有专票没有普票
  • 发票上月开本月到账要交企业所得税吗?
  • 公司没有残疾人要交残疾人保障金吗
  • 增值税 附加税
  • 或有负债披露原则
  • 收款收据怎么写 样本
  • 暂估入库有时间限制吗
  • 鸿蒙系统怎么同步数据
  • 打开网页提示打开别的应用
  • 建筑公司能否开材料票
  • 能开运费发票吗?
  • 初级考试判断题怎么扣分
  • 结转消费成本的会计分录
  • 公司已开工程发票怎么开
  • 六千元左右
  • php的工作流程
  • 房地产会计核算地上地下成本分摊
  • php数组操作
  • css圆角边框弧度代码
  • php实现定时器
  • 水利基金忘记申报怎么查
  • 打印空白表格怎么制作
  • 管理费用二级科目明细可以自己设置吗
  • sql server数据库怎么使用
  • 企业固定资产内部控制审计研究论文
  • 以前年度差旅费退回
  • 其他应收款科目代码
  • 公司的零星开支怎么做账
  • 残保金账务处理会计科目
  • 委托加工账务处理受托方会计分录
  • 转让股权收入属于收入总额吗
  • 以前年度未处理往来账怎么叫
  • 办理产权证费用明细
  • 零申报报表怎么填写
  • 一般账户的网银操作员变更怎么办理
  • 农副产品免税发票可以抵扣吗?
  • 房租给托管公司
  • 会计错账更正方法口诀
  • sql server2005一个表中可以设置
  • windows8.
  • apache系统服务启动不了
  • 进程是什么 进程类型
  • win8怎么分配磁盘空间
  • kali渗透工具安装
  • windows超级管理员默认密码
  • xp系统怎么改文件类型
  • win 8系统怎么样
  • win8系统怎么样
  • linux下history命令显示历史指令记录的使用方法
  • 修改etc profile
  • jquery添加图片
  • jQuery插件ajaxFileUpload异步上传文件
  • 关于Air端与android端的通信实现
  • 安全的代码
  • python脚本运行命令
  • js的iframe
  • 税务局航天信息的操作流程
  • 单位自有住房免增值税吗
  • 淄博市地方税务局
  • 大连市国家税务网
  • 增值税网上申报步骤可以在手机上申报吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设