瑞芯微Rockchip开发者社区
登录
直播中
南中南
9年用户
1009经验值
擅长:光电显示
私信
关注
[问答]
Rock-X SDK是什么?怎样去编译Rock-X SDK呢
开启该帖子的消息推送
SDK
Rock-X SDK是什么?Rock-X SDK是有何功能呢?怎样去编译Rock-X SDK呢?
回帖
(1)
廉雁捷
2022-2-21 15:31:27
一、简介
Rock-X SDK 是基于 RK3399Pro/RK180X 等平台的一套 AI 组件库。开发者通过 Rock-X SDK 提供的 API 接口能够快速构建 AI 应用。
Rock-X SDK 当前支持 Python/C 编程语言, 支持运行于 RK3399Pro Android/Linux 平台、RK180X Linux 平台以及 PC Linux/MacOS/Windows(需要接 RK1808 计算棒)。
本文测试基于RV1109或RV1126的buildroot系统中,运行rock-x sdk。
SDK 提供的功能如下:
Rock-X SDK 文件说明
rv1126_rv1109/linux_sdk_rockchip/external/rockx$ tree -L 3
.
├── auth
│ ├── Android
│ │ ├── arm64-v8a
│ │ └── armeabi-v7a
│ ├── Linux
│ │ ├── aarch64
│ │ ├── armhf
│ │ └── x86_64
│ ├── README.md
│ └── Windows
│ └── RKauth_tool_v1.02.zip
├── ChangeLog.txt
├── CMakeLists.txt
├── demo
│ ├── command_line_demo # Rock-X SDK C 示例程序
│ │ ├── build
│ │ ├── build-android-rk3399pro-v7a.sh
│ │ ├── build-android-rk3399pro-v8a.sh
│ │ ├── build-linux-rk1806.sh
│ │ ├── build-linux-rk1808.sh
│ │ ├── build-linux-rk3399pro-on-device.sh
│ │ ├── build-linux-rk3399pro.sh
│ │ ├── build-linux-rv1109.sh
│ │ ├── build-linux-x86.sh
│ │ ├── cmake
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── rockx_body_mask_demo
│ │ ├── rockx_carplate_demo
│ │ ├── rockx_face_attribute_demo
│ │ ├── rockx_face_detection_demo
│ │ ├── rockx_face_landmark_demo
│ │ ├── rockx_face_masks_detection_demo
│ │ ├── rockx_face_recognition_demo
│ │ ├── rockx_head_detection_demo
│ │ ├── rockx_object_detection_demo
│ │ ├── rockx_object_track_demo
│ │ ├── rockx_person_detection_demo
│ │ ├── rockx_pose_body_demo
│ │ └── rockx_pose_finger_demo
│ └── rk3399pro_android_demo
│ ├── rockx-android-demo-carplate_recognition.zip
│ ├── rockx-android-demo-face_attribute.zip
│ ├── rockx-android-demo-face_landmark.zip
│ ├── rockx-android-demo-object_detection.zip
│ └── rockx-android-demo-pose_body.zip
├── doc
│ ├── Rockchip_Developer_Guide_RockX_SDK_CN.pdf
│ ├── Rockchip_Developer_Guide_RockX_SDK_EN.pdf
│ └── rockx_api_doc
│ └── html
├── LICENSE
├── python
│ ├── RockX-1.2.0-py3-none-any.whl
│ └── test
│ ├── camera
│ ├── image
│ └── __init__.py
├── sdk
│ ├── rockx-data
│ │ ├── carplate_align.data
│ │ ├── carplate_detection.data
│ │ ├── carplate_recognition.data
│ │ ├── face_attribute.data
│ │ ├── face_detection.data
│ │ ├── face_landmark5.data
│ │ ├── face_landmarks68.data
│ │ ├── face_liveness_2d.data
│ │ ├── face_recognition.data
│ │ ├── head_detection.data
│ │ ├── object_detection.data
│ │ ├── pose_body.data
│ │ ├── pose_finger.data
│ │ └── pose_hand.data
│ ├── rockx-data-rv1109 # 针对rv1109的 rock-x ai模型
│ │ ├── body_detection.data
│ │ ├── body_mask.data
│ │ ├── carplate_align.data
│ │ ├── carplate_detection.data
│ │ ├── carplate_recognition.data
│ │ ├── face_attribute.data
│ │ ├── face_detection_v2.data
│ │ ├── face_detection_v3.data
│ │ ├── face_detection_v3_fast.data
│ │ ├── face_detection_v3_large.data
│ │ ├── face_landmark5.data
│ │ ├── face_landmarks68.data
│ │ ├── face_mask_classify.data
│ │ ├── face_masks_detection.data
│ │ ├── face_recognition.data
│ │ ├── head_detection.data
│ │ ├── object_detection.data
│ │ ├── person_detection_v2.data
│ │ ├── person_detection_v3.data
│ │ ├── pose_body.data
│ │ ├── pose_body_v2.data
│ │ ├── pose_finger.data
│ │ └── pose_hand.data
│ ├── rockx-rk1806-Linux
│ │ ├── include
│ │ ├── lib
│ │ ├── lib64
│ │ └── RockXConfig.cmake
│ ├── rockx-rk1808-Linux
│ │ ├── include
│ │ ├── lib64
│ │ └── RockXConfig.cmake
│ ├── rockx-rk3399pro-Android
│ │ ├── arm64-v8a
│ │ ├── armeabi-v7a
│ │ ├── include
│ │ └── RockXConfig.cmake
│ ├── rockx-rk3399pro-Linux
│ │ ├── include
│ │ ├── lib64
│ │ └── RockXConfig.cmake
│ ├── rockx-rv1109-Linux # 针对rv1109的 rock-x 动态链接库和头文件
│ │ ├── include
│ │ ├── lib
│ │ └── RockXConfig.cmake
│ └── rockx-x86-64-Linux
│ ├── include
│ ├── lib64
│ └── RockXConfig.cmake
└── VERSION
57 directories, 68 files
二、编译Rock-X SDK
使用RK_SDK_rv1126_rv1109_linux SDK
1.下载编译CMake
rockx sdk的编译需要基于 3.10 以上版本的cmake, 如果系统的cmake版本比较旧,则需要更新cmake。
$ sudo apt-get install build-essential
$ cd ~/Download/
$ wget
$ tar -zxvf cmake-3.11.3.tar.gz
$ cd cmake-3.11.3
$ ./configure
$ make
# $ sudo make install
$ ~/Downloads/cmake-3.11.3/bin/cmake -version
cmake version 3.11.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
为了不应用系统已安装的cmake,可以不使用install。
2.修改编译环境
修改 external/rockx/demo/command_line_demo/build-linux-rv1109.sh
修改交叉编译工具链路径
修改cmake路径
手动编译
cd external/rockx/demo/command_line_demo
git diff build-linux-rv1109.sh
diff --git a/demo/command_line_demo/build-linux-rv1109.sh b/demo/command_line_demo/build-linux-rv1109.sh
index fa569de..5a34df1 100755
--- a/demo/command_line_demo/build-linux-rv1109.sh
+++ b/demo/command_line_demo/build-linux-rv1109.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-GCC_COMPILER_PATH=~/opts/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf
+GCC_COMPILER_PATH=/home/ubuntu/disk1/rv1126_rv1109/linux_sdk_rockchip/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf
#BUILD_TYPE=Release
BUILD_TYPE=Debug
@@ -13,14 +14,16 @@ if [[ ! -d "${BUILD_DIR}" ]]; then
mkdir -p ${BUILD_DIR}
fi
+CMAKE_DIR=/home/ubuntu/Downloads/cmake-3.11.3/bin
+
cd ${BUILD_DIR}
-cmake ../..
+${CMAKE_DIR}/cmake ../..
-DTARGET_SOC=rv1109
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_C_COMPILER=${GCC_COMPILER_PATH}-gcc
-DCMAKE_CXX_COMPILER=${GCC_COMPILER_PATH}-g++
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${ROOT_PWD}/install/rockx_rv1109_linux
-make -j4
-make install
+#make -j4
+#make install
cd -
3.配置编译rockx
$ cd external/rockx/demo/command_line_demo
# 配置编译环境
$ bash build-linux-rv1109.sh
rockx_demo
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/disk1/rv1126_rv1109/linux_sdk_rockchip/external/rockx/demo/command_line_demo/build/build_rv1109_linux
/home/ubuntu/disk1/rv1126_rv1109/linux_sdk_rockchip/external/rockx/demo/command_line_demo
# 编译
$ cd ./build/build_rv1109_linux/
$ make
[ 6%] Built target rockx_face_detection
[ 13%] Built target rockx_face_landmark
[ 20%] Built target rockx_object_detection
[ 26%] Built target rockx_pose_body
[ 33%] Built target rockx_pose_body_async
[ 40%] Built target rockx_pose_finger
[ 46%] Built target rockx_face_recognition
[ 53%] Built target rockx_face_attribute
[ 60%] Built target rockx_head_detection
[ 66%] Built target rockx_carplate
[ 73%] Built target rockx_object_track
[ 80%] Built target rockx_face_masks_detection
[ 86%] Built target rockx_body_mask
[ 93%] Built target rockx_person_detection
[100%] Built target rockx_person_detection_async
三、在buildroot系统中运行rockx
1.复制编译结果和依赖文件到本地
将主机的编译结果和动态库等文件拷贝到RV1109或RV1126设备中
$ cd external/rockx/
$ scp -r sdk/ root@xxx:/userdata/rockx
$ scp -r demo/command_line_demo/ root@xxx:/userdata/rockx
2.加入动态链接库新搜索路径
# RV1109设备上
cd /userdata/rockx
# 将动态库和头文件放到与AI模型同一路径下
cp sdk/rockx-rv1109-Linux/lib/* sdk/rockx-data-rv1109/
cp sdk/rockx-rv1109-Linux/include/ sdk/rockx-data-rv1109/
# 修改环境变量
vi /etc/profile
# 加入
ROCKX_DATA_PATH=/userdata/rockx/sdk/rockx-data-rv1109
export LD_LIBRARY_PATH=${ROCKX_DATA_PATH}:$LD_LIBRARY_PATH
source /etc/profile
也可以直接把动态库和AI模型复制到系统路径
cp sdk/rockx-rv1109-Linux/lib/* /usr/lib/
cp sdk/rockx-rv1109-Linux/include/ /usr/lib/
cp sdk/rockx-data-rv1109/ /usr/lib/
3.运行rockx demo 可执行文件
$ cd /userdata/rockx/command_line_demo/build/build_rv1109_linux/rockx_carplate_demo
# 运行车牌识别程序
$ ./rockx_carplate ../../../rockx_carplate_demo/carplate_det_test1.jpg
(56 111 190 151) 0.986012
一、简介
Rock-X SDK 是基于 RK3399Pro/RK180X 等平台的一套 AI 组件库。开发者通过 Rock-X SDK 提供的 API 接口能够快速构建 AI 应用。
Rock-X SDK 当前支持 Python/C 编程语言, 支持运行于 RK3399Pro Android/Linux 平台、RK180X Linux 平台以及 PC Linux/MacOS/Windows(需要接 RK1808 计算棒)。
本文测试基于RV1109或RV1126的buildroot系统中,运行rock-x sdk。
SDK 提供的功能如下:
Rock-X SDK 文件说明
rv1126_rv1109/linux_sdk_rockchip/external/rockx$ tree -L 3
.
├── auth
│ ├── Android
│ │ ├── arm64-v8a
│ │ └── armeabi-v7a
│ ├── Linux
│ │ ├── aarch64
│ │ ├── armhf
│ │ └── x86_64
│ ├── README.md
│ └── Windows
│ └── RKauth_tool_v1.02.zip
├── ChangeLog.txt
├── CMakeLists.txt
├── demo
│ ├── command_line_demo # Rock-X SDK C 示例程序
│ │ ├── build
│ │ ├── build-android-rk3399pro-v7a.sh
│ │ ├── build-android-rk3399pro-v8a.sh
│ │ ├── build-linux-rk1806.sh
│ │ ├── build-linux-rk1808.sh
│ │ ├── build-linux-rk3399pro-on-device.sh
│ │ ├── build-linux-rk3399pro.sh
│ │ ├── build-linux-rv1109.sh
│ │ ├── build-linux-x86.sh
│ │ ├── cmake
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── rockx_body_mask_demo
│ │ ├── rockx_carplate_demo
│ │ ├── rockx_face_attribute_demo
│ │ ├── rockx_face_detection_demo
│ │ ├── rockx_face_landmark_demo
│ │ ├── rockx_face_masks_detection_demo
│ │ ├── rockx_face_recognition_demo
│ │ ├── rockx_head_detection_demo
│ │ ├── rockx_object_detection_demo
│ │ ├── rockx_object_track_demo
│ │ ├── rockx_person_detection_demo
│ │ ├── rockx_pose_body_demo
│ │ └── rockx_pose_finger_demo
│ └── rk3399pro_android_demo
│ ├── rockx-android-demo-carplate_recognition.zip
│ ├── rockx-android-demo-face_attribute.zip
│ ├── rockx-android-demo-face_landmark.zip
│ ├── rockx-android-demo-object_detection.zip
│ └── rockx-android-demo-pose_body.zip
├── doc
│ ├── Rockchip_Developer_Guide_RockX_SDK_CN.pdf
│ ├── Rockchip_Developer_Guide_RockX_SDK_EN.pdf
│ └── rockx_api_doc
│ └── html
├── LICENSE
├── python
│ ├── RockX-1.2.0-py3-none-any.whl
│ └── test
│ ├── camera
│ ├── image
│ └── __init__.py
├── sdk
│ ├── rockx-data
│ │ ├── carplate_align.data
│ │ ├── carplate_detection.data
│ │ ├── carplate_recognition.data
│ │ ├── face_attribute.data
│ │ ├── face_detection.data
│ │ ├── face_landmark5.data
│ │ ├── face_landmarks68.data
│ │ ├── face_liveness_2d.data
│ │ ├── face_recognition.data
│ │ ├── head_detection.data
│ │ ├── object_detection.data
│ │ ├── pose_body.data
│ │ ├── pose_finger.data
│ │ └── pose_hand.data
│ ├── rockx-data-rv1109 # 针对rv1109的 rock-x ai模型
│ │ ├── body_detection.data
│ │ ├── body_mask.data
│ │ ├── carplate_align.data
│ │ ├── carplate_detection.data
│ │ ├── carplate_recognition.data
│ │ ├── face_attribute.data
│ │ ├── face_detection_v2.data
│ │ ├── face_detection_v3.data
│ │ ├── face_detection_v3_fast.data
│ │ ├── face_detection_v3_large.data
│ │ ├── face_landmark5.data
│ │ ├── face_landmarks68.data
│ │ ├── face_mask_classify.data
│ │ ├── face_masks_detection.data
│ │ ├── face_recognition.data
│ │ ├── head_detection.data
│ │ ├── object_detection.data
│ │ ├── person_detection_v2.data
│ │ ├── person_detection_v3.data
│ │ ├── pose_body.data
│ │ ├── pose_body_v2.data
│ │ ├── pose_finger.data
│ │ └── pose_hand.data
│ ├── rockx-rk1806-Linux
│ │ ├── include
│ │ ├── lib
│ │ ├── lib64
│ │ └── RockXConfig.cmake
│ ├── rockx-rk1808-Linux
│ │ ├── include
│ │ ├── lib64
│ │ └── RockXConfig.cmake
│ ├── rockx-rk3399pro-Android
│ │ ├── arm64-v8a
│ │ ├── armeabi-v7a
│ │ ├── include
│ │ └── RockXConfig.cmake
│ ├── rockx-rk3399pro-Linux
│ │ ├── include
│ │ ├── lib64
│ │ └── RockXConfig.cmake
│ ├── rockx-rv1109-Linux # 针对rv1109的 rock-x 动态链接库和头文件
│ │ ├── include
│ │ ├── lib
│ │ └── RockXConfig.cmake
│ └── rockx-x86-64-Linux
│ ├── include
│ ├── lib64
│ └── RockXConfig.cmake
└── VERSION
57 directories, 68 files
二、编译Rock-X SDK
使用RK_SDK_rv1126_rv1109_linux SDK
1.下载编译CMake
rockx sdk的编译需要基于 3.10 以上版本的cmake, 如果系统的cmake版本比较旧,则需要更新cmake。
$ sudo apt-get install build-essential
$ cd ~/Download/
$ wget
$ tar -zxvf cmake-3.11.3.tar.gz
$ cd cmake-3.11.3
$ ./configure
$ make
# $ sudo make install
$ ~/Downloads/cmake-3.11.3/bin/cmake -version
cmake version 3.11.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
为了不应用系统已安装的cmake,可以不使用install。
2.修改编译环境
修改 external/rockx/demo/command_line_demo/build-linux-rv1109.sh
修改交叉编译工具链路径
修改cmake路径
手动编译
cd external/rockx/demo/command_line_demo
git diff build-linux-rv1109.sh
diff --git a/demo/command_line_demo/build-linux-rv1109.sh b/demo/command_line_demo/build-linux-rv1109.sh
index fa569de..5a34df1 100755
--- a/demo/command_line_demo/build-linux-rv1109.sh
+++ b/demo/command_line_demo/build-linux-rv1109.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-GCC_COMPILER_PATH=~/opts/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf
+GCC_COMPILER_PATH=/home/ubuntu/disk1/rv1126_rv1109/linux_sdk_rockchip/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf
#BUILD_TYPE=Release
BUILD_TYPE=Debug
@@ -13,14 +14,16 @@ if [[ ! -d "${BUILD_DIR}" ]]; then
mkdir -p ${BUILD_DIR}
fi
+CMAKE_DIR=/home/ubuntu/Downloads/cmake-3.11.3/bin
+
cd ${BUILD_DIR}
-cmake ../..
+${CMAKE_DIR}/cmake ../..
-DTARGET_SOC=rv1109
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_C_COMPILER=${GCC_COMPILER_PATH}-gcc
-DCMAKE_CXX_COMPILER=${GCC_COMPILER_PATH}-g++
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${ROOT_PWD}/install/rockx_rv1109_linux
-make -j4
-make install
+#make -j4
+#make install
cd -
3.配置编译rockx
$ cd external/rockx/demo/command_line_demo
# 配置编译环境
$ bash build-linux-rv1109.sh
rockx_demo
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/disk1/rv1126_rv1109/linux_sdk_rockchip/external/rockx/demo/command_line_demo/build/build_rv1109_linux
/home/ubuntu/disk1/rv1126_rv1109/linux_sdk_rockchip/external/rockx/demo/command_line_demo
# 编译
$ cd ./build/build_rv1109_linux/
$ make
[ 6%] Built target rockx_face_detection
[ 13%] Built target rockx_face_landmark
[ 20%] Built target rockx_object_detection
[ 26%] Built target rockx_pose_body
[ 33%] Built target rockx_pose_body_async
[ 40%] Built target rockx_pose_finger
[ 46%] Built target rockx_face_recognition
[ 53%] Built target rockx_face_attribute
[ 60%] Built target rockx_head_detection
[ 66%] Built target rockx_carplate
[ 73%] Built target rockx_object_track
[ 80%] Built target rockx_face_masks_detection
[ 86%] Built target rockx_body_mask
[ 93%] Built target rockx_person_detection
[100%] Built target rockx_person_detection_async
三、在buildroot系统中运行rockx
1.复制编译结果和依赖文件到本地
将主机的编译结果和动态库等文件拷贝到RV1109或RV1126设备中
$ cd external/rockx/
$ scp -r sdk/ root@xxx:/userdata/rockx
$ scp -r demo/command_line_demo/ root@xxx:/userdata/rockx
2.加入动态链接库新搜索路径
# RV1109设备上
cd /userdata/rockx
# 将动态库和头文件放到与AI模型同一路径下
cp sdk/rockx-rv1109-Linux/lib/* sdk/rockx-data-rv1109/
cp sdk/rockx-rv1109-Linux/include/ sdk/rockx-data-rv1109/
# 修改环境变量
vi /etc/profile
# 加入
ROCKX_DATA_PATH=/userdata/rockx/sdk/rockx-data-rv1109
export LD_LIBRARY_PATH=${ROCKX_DATA_PATH}:$LD_LIBRARY_PATH
source /etc/profile
也可以直接把动态库和AI模型复制到系统路径
cp sdk/rockx-rv1109-Linux/lib/* /usr/lib/
cp sdk/rockx-rv1109-Linux/include/ /usr/lib/
cp sdk/rockx-data-rv1109/ /usr/lib/
3.运行rockx demo 可执行文件
$ cd /userdata/rockx/command_line_demo/build/build_rv1109_linux/rockx_carplate_demo
# 运行车牌识别程序
$ ./rockx_carplate ../../../rockx_carplate_demo/carplate_det_test1.jpg
(56 111 190 151) 0.986012
举报
更多回帖
rotate(-90deg);
回复
相关问答
SDK
怎样
使用
Rock-X
SDK
进行车牌识别快速开发
呢
2022-03-07
2111
Rock-X
SDK
的定义与使用解析
2022-02-14
2588
怎样
使用
Rock-X
SDK
进行车牌识别快速开发
呢
2022-03-04
2027
如何对RK3399+RK1808人工智能计算棒的被动模式进行
Rock-X
测试
呢
2022-02-15
2052
请问一下apk该
怎样
去
安装并使用
呢
2022-02-14
844
怎样
去
获取
SDK
源码
呢
2022-02-10
1421
请问一下
怎样
去
移植官方
SDK
呢
2022-03-01
611
rk3399
编译
u-boot报错Error
怎样
去
解决
呢
2022-05-30
3020
如何对RV1109开发板下载的
SDK
包重新
编译
呢
2022-03-10
3172
RK356
X
Android11.0
SDK
正常
编译
后,其他Android版本
SDK
会报JACK错误怎么解决?
2022-03-02
843
发帖
登录/注册
20万+
工程师都在用,
免费
PCB检查工具
无需安装、支持浏览器和手机在线查看、实时共享
查看
点击登录
登录更多精彩功能!
英国威廉希尔公司网站
william hill官网 版块
小组
免费开发板试用
ebook
直播
搜索
登录
×
20
完善资料,
赚取积分