全网首发,人体姿态估计算法在OK3588上部署应用(十三)

一、主机模型转换

采用FastDeploy来部署应用深度学习模型到OK3588板卡上

进入主机Ubuntu的虚拟环境

conda activate ok3588

主机环境搭建可以参考上一篇 《OK3588板卡实现人像抠图(十二)》

生成onnx文件
python 复制代码
cd FastDeploy
# 下载Paddle静态图模型并解压
wget https://bj.bcebos.com/paddlehub/fastdeploy/PP_TinyPose_256x192_infer.tgz
tar -xvf PP_TinyPose_256x192_infer.tgz

# 静态图转ONNX模型,注意,这里的save_file请和压缩包名对齐
paddle2onnx --model_dir PP_TinyPose_256x192_infer \
            --model_filename model.pdmodel \
            --params_filename model.pdiparams \
            --save_file PP_TinyPose_256x192_infer/PP_TinyPose_256x192_infer.onnx \
            --enable_dev_version True

# 固定shape
python -m paddle2onnx.optimize --input_model PP_TinyPose_256x192_infer/PP_TinyPose_256x192_infer.onnx \
                                --output_model PP_TinyPose_256x192_infer/PP_TinyPose_256x192_infer.onnx \
                                --input_shape_dict "{'image':[1,3,256,192]}"

转换成RKNN模型

python 复制代码
python tools/rknpu2/export.py --config_path tools/rknpu2/config/PP_TinyPose_256x192_unquantized.yaml \
                              --target_platform rk3588

把PP_TinyPose_256x192_infer文件夹打包放到OK3588板卡上

二、板卡模型部署

进入虚拟环境

conda activate ok3588

cd FastDeploy/examples/vision/keypointdetection/tiny_pose/rknpu2/cpp

mkdir build

cd build

cmake .. -DFASTDEPLOY_INSTALL_DIR=/home/forlinx/FastDeploy/build/fastdeploy-0.0.0/

make -j

得到了编译后的文件 infer_tinypose_demo

三、执行推理

PP_TinyPose_256x192_infer 文件夹放在build里面

NPU推理

sudo ./infer_tinypose_demo PP_TinyPose_256x192_infer pose.jpg

推理结果展示,即便是个钢铁侠模型,还是可以准确的识别出关键点哈

相关推荐
tedcloud123几秒前
book-to-skill 怎么部署?把技术书和项目文档变成 AI Agent 可复用知识
linux·运维·服务器·人工智能·开源
世优科技虚拟人4 分钟前
AI数字人企业升级全息舱交互,数字人全息仓让展厅展馆更智慧
人工智能·ai数字人·全息舱数字人·全息数字人
webor20066 分钟前
<七>从3秒记忆到过目不忘——语言模型的三代进化
人工智能·语言模型·自然语言处理
TechEdu2026067 分钟前
[人工智能]SciPy在工程计算中的作用与实践
人工智能·ai·scipy
七牛云行业应用9 分钟前
DeepSeek Harness vs Codex vs Claude Code:三款 AI 编程 Harness 深度对比
人工智能·agent·ai编程
无凭13 分钟前
拆解 DeerFlow Memory:Agent 的长期记忆到底怎么做?
人工智能·设计模式
格尔曼Noah30 分钟前
文本转音频技术选型指南:2026年主流TTS与端到端语音大模型深度对比
人工智能·语音识别
hans汉斯39 分钟前
采煤工作面隐患目标检测中YOLO11与Faster R-CNN的对比研究
人工智能·目标检测·计算机视觉·cnn·信息与通信·信号处理
神奇小汤圆1 小时前
从 0 用 AgentTeams 搭一个多 Agent 模拟面试系统
人工智能
潘正翔1 小时前
DeepSeek Harness从0到1部署
人工智能·开发·codex·deepseek·harness·deepseekharness·cludecode