全网首发,人体姿态估计算法在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

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

相关推荐
星光技术人1 分钟前
Enhancing End-to-End Autonomous Driving with Latent World Model
人工智能·深度学习·计算机视觉·自动驾驶·vln
code_pgf2 分钟前
mllm指令微调的关键技术
人工智能·机器学习·计算机视觉
卷卷说风控3 分钟前
【卷卷观察】AI 安全与信任危机:恶意机器人、AI 买家秀、模型自保 安全、治理、虚假内容成为高频议题 “AI 越有用,越需要被约束”
人工智能·安全·机器人
漫游的渔夫3 分钟前
从 if-else 乱麻到状态机:前端开发者该怎么理解多 Agent 协作?
前端·人工智能·typescript
机器人零零壹4 分钟前
工业软件加速突围:iRobotCAM 如何以国产内核扛起机器人离线编程自主大旗
人工智能·具身智能·人形机器人·机器人仿真·工业软件·中望3d·机器人离线编程
Elastic 中国社区官方博客4 分钟前
一个索引,所有媒体:介绍 jina-embeddings-v5-omni
大数据·人工智能·elasticsearch·搜索引擎·ai·媒体·jina
嘛也学不会4 分钟前
Claude技能构建指南|第三章 测试流程与迭代优化
人工智能·教程·skill·技能构建
舞影天上5 分钟前
给 AI Agent 接上记忆系统:Honcho + DeepSeek 踩坑全记录
人工智能
王木风7 分钟前
GitHub 日增近 4k star 的 skills 项目:用 18 个技能,解决 Claude Code 的四大“翻车”现场
人工智能
covco8 分钟前
AI 原生营销矩阵系统:分布式架构设计与核心模块实现
人工智能·分布式·矩阵