1 Star 0 Fork 0

xxl1j2n/PifPaf-TensorRT-Pose-Estimation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
generate_tensorrt.bash 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
config="$1"
run_on_jetson="$2"
imageSize=$(sed -nr "/^\[PoseEstimator\]/ { :l /^InputSize[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $config)
IFS=',' read -a marray <<< "$imageSize"
width=${marray[0]}
height=${marray[1]}
workdir="/repo/pose-estimation/"
onnx_dir="${work_dir}data/onnx"
mkdir -p $onnx_dir
onnx_name_openpifpaf="${work_dir}data/onnx/openpifpaf_resnet50_${width}_${height}.onnx"
onnx_openpifpaf_download_url="https://media.githubusercontent.com/media/neuralet/neuralet-models/c874b2bcee0521d770d3480ed5fef25643160abd/ONNX/openpifpaf_12a4/openpifpaf_resnet50_${width}_${height}.onnx"
if [[ ! $run_on_jetson ]] && [[ ! -f $onnx_name_openpifpaf ]]; then
echo "############## exporting ONNX from OpenPifPaf ##################"
python3 -m openpifpaf.export_onnx --outfile $onnx_name_openpifpaf --checkpoint resnet50 --input-width $width --input-height $height
elif [[ $run_on_jetson ]] && [[ ! -f $onnx_name_openpifpaf ]]; then
wget $onnx_openpifpaf_download_url -O $onnx_name_openpifpaf
fi
tensorrt_dir="${work_dir}data/tensorrt/"
mkdir -p $tensorrt_dir
precision_detector=$(sed -nr "/^\[PoseEstimator\]/ { :l /^TensorrtPrecision[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" $config)
tensorrt_name_openpifpaf="${tensorrt_dir}openpifpaf_resnet50_${width}_${height}_d${precision_detector}.trt"
if [ ! -f $tensorrt_name_openpifpaf ]; then
echo "############## Generating TensorRT Engine for openpifpaf ######################"
onnx2trt $onnx_name_openpifpaf -o $tensorrt_name_openpifpaf -d $precision_detector -b 1
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liangjienan/PifPaf-TensorRT-Pose-Estimation.git
[email protected]:liangjienan/PifPaf-TensorRT-Pose-Estimation.git
liangjienan
PifPaf-TensorRT-Pose-Estimation
PifPaf-TensorRT-Pose-Estimation
main

搜索帮助