位置: 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基础知识)

  • 上年度已交房产税减免如何做账务处理
  • 二手房缴纳个税是买方缴还是卖方缴?
  • 企业所得税多缴退税规定
  • 进出口企业外汇收支平衡
  • 报税软件费用可以退吗
  • 个体餐饮要交什么税
  • 公司账户被法院冻结了多久可以恢复
  • 免退税企业结转怎么操作
  • 增值税采用零税率政策的内容
  • 委托加工农产品的扣除率
  • 债券分期还本利息怎么算
  • 下脚料回收
  • 建筑公司对外如何开票
  • 代扣代缴税种有几个
  • 2020年资金账簿印花税最新规定
  • 非居民企业啥意思
  • 公司以银行存款名义为员工垫付医疗费分录怎么写
  • 企业核销应收账款需要什么资料
  • 收到快递关税做什么科目
  • 保证金计入哪个会计科目
  • 公司没有发票的做内账,那么支付款从哪里来
  • 外派人员计算个人所得税可否有附加扣除
  • 利用Windows Media将二进制文件转音频
  • 红字发票怎么填申报表表二
  • 结算起点为
  • 公司向私人借款利息可以入账吗
  • 个税这个月多交了下个月减回来
  • 累积带薪缺勤的原因分析
  • ant-design-vue pro
  • php反射的原理
  • 如何修改php网页内容
  • 土地出让金抵减增值税账务处理
  • ausearch命令
  • php基于单例模式开发
  • 收缴违约金
  • 电汇跟支票的区别
  • 浅析学校德育的个体智能发展功能
  • python tkinter entry用法
  • 个体户餐饮服务包括哪些经营范围
  • db2获取当前年月日
  • 固定资产中的动产和不动产
  • 企业的预付账款属于金融资产吗
  • 加计抵减不符合怎么办
  • 企业专项资金购买固定资产
  • 电影剧本稿费多少
  • 不动产分割要哪些步骤
  • 土地前期开发费用属于开发成本吗
  • 社会保险费结算表怎么打印
  • 建筑行业收到工程款延期付款利息需不需要开票
  • 总公司委托分公司开票及收款
  • 销售货物海运费会计分录
  • 广告费支出的税种有哪些
  • 金税三期网络设置
  • 会计一般月初忙几天
  • sqlserver 中文字符集
  • sqlserver数据库怎么导出
  • Linux下MySQL5.7.18 yum方式从卸载到安装过程图解
  • windowsxp
  • 2015微软发布会
  • windows域环境搭建
  • win8删除所有文件
  • linux cwd
  • ubuntu集成开发环境
  • 国产系统麒麟和统信
  • 苹果预计10.1-15号到能准确吗
  • Win10预览版镜像
  • Android屏幕外侧滑条
  • 电脑windows自动关闭
  • 批处理文件.bat
  • cocos3.0
  • cocos2d官网
  • 运行shell脚本命令 sh
  • 字符串截取用什么方法
  • 使用jquery实现的项目
  • [置顶] [Android Studio 权威教程]最实用的快捷键
  • python 多线程
  • 美股印花税如何收取
  • 航天金税软件怎么下载
  • 医院的电子收据怎么查
  • 航天金税开票软件客服电话
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设