赞
踩
到上面的github网站下载跟踪代码,该代码使用YOLOv8作为检测网络,不过YOLOv8的文件需要去下面的链接下载,然后替换掉跟踪代码中YOLOv8的空文件。
https://github.com/ultralytics/ultralytics
见我的另外两偏文章:
orin上安装cuda pytorch gpu运行环境
使用Yolov8进行目标检测并训练自己的数据集
再根据
# pip install -r requirements.txt ultralytics==8.0.20 # Base ---------------------------------------- gitpython ipython # interactive notebook matplotlib>=3.2.2 numpy==1.23.1 opencv-python>=4.1.1 Pillow>=7.1.2 psutil # system resources PyYAML>=5.3.1 requests>=2.23.0 scipy>=1.4.1 thop>=0.1.1 # FLOPs computation torch>=1.7.0 # see https://pytorch.org/get-started/locally (recommended) torchvision>=0.8.1 tqdm>=4.64.0 # protobuf<=3.20.1 # https://github.com/ultralytics/yolov5/issues/8012 # Logging --------------------------------------------------------------------- tensorboard>=2.4.1 # clearml>=1.2.0 # comet # Plotting -------------------------------------------------------------------- pandas>=1.1.4 seaborn>=0.11.0 # StrongSORT ------------------------------------------------------------------ easydict # torchreid ------------------------------------------------------------------- gdown # ByteTrack ------------------------------------------------------------------- lap # OCSORT ---------------------------------------------------------------------- filterpy
这个我下载了yolov8s
https://github.com/mikel-brostrom/yolov8_tracking/releases/download/v9.0/lmbn_n_cuhk03_d.pth
下载后改名 lmbn_n_cuhk03_d.pt,放到./weights
osnet_x1_0_imagenet.pth模型.下载地址:
https://drive.google.com/uc?id=1LaG1EJpHrxdAxKnSCJ_i0u-nbxSAeiFY
下载后,放到
~/.cache/torch/checkpoints
python track.py --source /home/xxx/AR0820_800W_H60_1.mp4 --tracking-method deepocsort --show-vid --yolo-weights ./yolov8/weights/yolov8s.pt
其他命令具体见github
ImportError: cannot import name 'attempt_download' from 'ultralytics.yolo.utils.downloads' (/home/xxxx/anaconda3/envs/pytorch_gpu/lib/python3.8/site-packages/ultralytics/yolo/utils/downloads.py)
yolov8环境版本问题
pip install ultralytics
pip install ultralytics==8.0.20
问题解决
在
cached_file = os.path.join(model_dir, filename)
print("cached_file=",cached_file)
if not os.path.exists(cached_file):
gdown.download(pretrained_urls[key], cached_file, quiet=False)
下载torch/checkpoints/osnet_x1_0_imagenet.pth文件的时候下载不下来报错。
将下载网址打印出来,找到有vpn的地方下载
https://drive.google.com/uc?id=1LaG1EJpHrxdAxKnSCJ_i0u-nbxSAeiFY
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。