目录
1.代码环境搭建
2. 报错解决方案
3. 运行调试
4. 演示演示结果
文件夹 torchreid (https://github.com/KaiyangZhou/deep-person-reid.git)
整理一下,目录结构大致是这样的
安装包,配置国内源比较快一点,我用的是清华源,至此基本完成项目配置
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
小结:
pycharm 建立项目要熟练的使用,不然要搞的晕头转向,还有环境的切换,个人简易可以随便拉个python项目用conda下载包,换源,卸载包,这类的操作熟练,反正我就好烦,我电脑直接盘不够用,直接搞服务器了,
原因:缺少相关库文件;
在网上检索了一下,目前有几种解决:
用户界面和基础结构这下面三个全选中,然后等待安装,安装完成后会重启服务器,再次连接就行了,安装时间一般为5-10 分钟
这个需要到谷歌盘下载,不是下载不了的,下载不了是运行不了的,这个是权重的分享链接
这个是分享的链接
链接:https://pan.baidu.com/s/1jGcxCNi4agTdVz-IkN_UIA
提取码:1111
…
运行参数就这些,调整这些运行参数,来完成相应的功能
官方文档的用法,参考下,
Tracking can be run on most video formats
$ python track.py --source 0 # webcam
img.jpg # image
vid.mp4 # video
path/ # directory
path/*.jpg # glob
'https://youtu.be/Zgi9g1ksQHc' # YouTube
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
There is a clear trade-off between model inference speed and accuracy. In order to make it possible to fulfill your inference speed/accuracy needs you can select a Yolov5 family model for automatic download
$ python track.py --source 0 --yolo_model yolov5n.pt --img 640
yolov5s.pt
yolov5m.pt
yolov5l.pt
yolov5x.pt --img 1280
...
The above applies to DeepSort models as well. Choose a ReID model based on your needs from this ReID model zoo
$ python track.py --source 0 --deep_sort_model osnet_x0_25_market1501
osnet_x0_5_market1501
osnet_x0_75_msmt17
osnet_x1_0_msmt17
...
By default the tracker tracks all MS COCO classes.
If you only want to track persons I recommend you to get these weights for increased performance
python3 track.py --source 0 --yolo_model yolov5/weights/crowdhuman_yolov5m.pt --classes 0 # tracks persons, only
If you want to track a subset of the MS COCO classes, add their corresponding index after the classes flag
python3 track.py --source 0 --yolo_model yolov5s.pt --classes 16 17 # tracks cats and dogs, only
Here is a list of all the possible objects that a Yolov5 model trained on MS COCO can detect. Notice that the indexing for the classes in this repo starts at zero.
Can be saved to your experiment folder runs/track/
by
python3 track.py --source ... --save-txt
按照参考文档的方法进行使用,
目标跟踪