本文项目:
github:https://github.com/Whiffe/yolov5-slowfast-deepsort-PytorchVideo
gitee:https://gitee.com/YFwinston/yolov5-slowfast-deepsort-PytorchVideo
b站视频:https://www.bilibili.com/video/BV1aP41137g6
在上一篇博客中:
【PyTorchVideo教程01】快速实现视频动作识别
可以发现PyTorchVideo的安装速度比较慢,其实官网提供了几种方法:
https://github.com/facebookresearch/pytorchvideo/blob/main/INSTALL.md
本文参考来自:
Yolov5+SlowFast: 基于PytorchVideo的实时行为检测算法
本文项目在极链AI中搭建:
https://cloud.videojj.com/auth/register?inviter=18452&activityChannel=student_invite
环境
Pytorch 1.10.1
Python 3.8
Cuda 11.1
cd /home
git clone https://gitee.com/YFwinston/pytorchvideo.git
cd pytorchvideo
pip install -e .
apt update
apt install libgl1-mesa-glx -y
使用gitee(推荐)
cd /home
git clone https://gitee.com/YFwinston/yolov5-slowfast-deepsort-PytorchVideo.git
cd /home/yolov5-slowfast-deepsort-PytorchVideo
pip install -r requirements2.txt
[yolov5_file]
[slowfast_file]
我是将ckpt.t7放在了:/user-data/yolov5_file/
我是将SLOWFAST_8x8_R50_DETECTION.pyth放在了:/user-data/slowfast_file/
我是将yolov5l6.pt放在了:/user-data/yolov5_file/
我是将yolov5-master.zip放在了:/user-data/yolov5_file/
mkdir -p /home/yolov5-slowfast-deepsort-PytorchVideo/deep_sort/deep_sort/deep/checkpoint/
cp /user-data/yolov5_file/ckpt.t7 /home/yolov5-slowfast-deepsort-PytorchVideo/deep_sort/deep_sort/deep/checkpoint/ckpt.t7
mkdir -p /root/.cache/torch/hub/checkpoints/
cp /user-data/slowfast_file/SLOWFAST_8x8_R50_DETECTION.pyth /root/.cache/torch/hub/checkpoints/SLOWFAST_8x8_R50_DETECTION.pyth
cp /user-data/yolov5_file/yolov5l6.pt /home/yolov5-slowfast-deepsort-PytorchVideo/yolov5l6.pt
cp /user-data/yolov5_file/yolov5-master.zip /root/.cache/torch/hub/master.zip
我将1.mp4存放在了/home/yolov5-slowfast-deepsort-PytorchVideo/demo/中
cd /home/yolov5-slowfast-deepsort-PytorchVideo
mkdir demo
cd /home/yolov5-slowfast-deepsort-PytorchVideo
python yolo_slowfast.py --input ./demo/1.mp4
b站:视频检测结果https://www.bilibili.com/video/BV1rV4y1u7uq
【PyTorchVideo教程02】检测结果 快速安装PyTorchVideo 采用 yolov5、slowfast、deepsort对学生课堂行为进行检测 视