人体姿势识别
本文尝试运行trt_pose项目。
安装依赖
安装PyTorch和Torchvision, 参见 安装Pytorch和Torchvision
安装 torch2trt
git clone https://github.com/NVIDIA-AI-IOT/torch2trt
cd torch2trt
sudo python3 setup.py install --plugins
- 安装其它依赖
sudo pip3 install tqdm cython pycocotools
sudo apt-get install python3-matplotlib
安装trt_pose
git clone https://github.com/NVIDIA-AI-IOT/trt_pose
cd trt_pose
sudo python3 setup.py install
安装jetcam
jetcam是一个jetson下操作usb和csi摄像头的库。
jetcam运行依赖模块traitlets,需先安装traitlets。
sudo pip3 install traitlets
然后安装jetcam
git clone https://github.com/NVIDIA-AI-IOT/jetcam
cd jetcam
sudo python3 setup.py install
运行示例
1import time
2
3t0 = time.time()
4torch.cuda.current_stream().synchronize()
5for i in range(50):
6 y = model_trt(data)
7
8torch.cuda.current_stream().synchronize()
9t1 = time.time()
10
11print(50.0 / (t1 - t0))