此文档使用yolov5-v5.0以及对应版本的tensorrtx包
一、安装依赖包
sudo apt install libssl1.0.0 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 libjansson4=2.11-1
二、下载并安装deepstream sdk
1)下载DeepStream 5.1 Jetson tar package deepstream_sdk_v5.1.0_jetson.tbz2 2)解压并安装 sudo tar -xvf deepstream_sdk_v5.1.0_jetson.tbz2 -C / cd /opt/nvidia/deepstream/deepstream-5.1 sudo ./install.sh sudo ldconfig
三、在电脑端完成模型pt转wts
(此处务必检查yolov5与tensorrtx包的版本) git clone -b v5.0 https://github.com/ultralytics/yolov5.git git clone -b yolov5-v5.0 https://github.com/wang-xinyu/tensorrtx.git cp {tensorrtx}/yolov5/gen_wts.py {ultralytics}/yolov5 cd {ultralytics}/yolov5 python gen_wts.py -w best.pt -o best.wts
四、在jetson上完成wts转engine
1)在jetson上克隆v5.0版本tensorrtx git clone -b yolov5-v5.0 https://github.com/wang-xinyu/tensorrtx.git 2)编译 #检查yolov5.cpp中的模型权重NET,默认的是s #检查yololayer.h中CLASS_NUM的数量,默认的是80 cd tensorrtx/yolov5 mkdir build cd build cmake … make 3)复制best.wts到tensorrtx/yolov5/build目录下 4)生成yolov5s.engine sudo ./yolov5 -s best.wts yolov5s.engine s sudo ./yolov5 -d yolov5s.engine …/samples
五、未完待续
|