PyTorchVideo教程02快速安装PyTorchVideo 采用 yolov5slowfastdeepsort对学生课堂行为进行检测
Posted CV-杨帆
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PyTorchVideo教程02快速安装PyTorchVideo 采用 yolov5slowfastdeepsort对学生课堂行为进行检测相关的知识,希望对你有一定的参考价值。
目录
0 前言
本文项目:
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的实时行为检测算法
1 GPU平台
本文项目在极链AI中搭建:
https://cloud.videojj.com/auth/register?inviter=18452&activityChannel=student_invite
环境
Pytorch 1.10.1
Python 3.8
Cuda 11.1
2 安装PyTorchVideo
cd /home
git clone https://gitee.com/YFwinston/pytorchvideo.git
cd pytorchvideo
pip install -e .
apt update
apt install libgl1-mesa-glx -y
3 安装yolov5-slowfast-deepsort-PytorchVideo
3.1 下载yolov5-slowfast-deepsort-PytorchVideo
使用gitee(推荐)
cd /home
git clone https://gitee.com/YFwinston/yolov5-slowfast-deepsort-PytorchVideo.git
3.2 安装
cd /home/yolov5-slowfast-deepsort-PytorchVideo
pip install -r requirements2.txt
3.3 下载文件
我是将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
3.4 测试
我将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
3.5 结果
b站:视频检测结果https://www.bilibili.com/video/BV1rV4y1u7uq
【PyTorchVideo教程02】检测结果 快速安装PyTorchVideo 采用 yolov5、slowfast、deepsort对学生课堂行为进行检测 视
以上是关于PyTorchVideo教程02快速安装PyTorchVideo 采用 yolov5slowfastdeepsort对学生课堂行为进行检测的主要内容,如果未能解决你的问题,请参考以下文章