Skip to content

Commit 2d8318b

Browse files
authored
Merge pull request #138 from HyperInspire/dev/rk356x
Dev/rk356x Former-commit-id: c89a629
2 parents a3b492c + 02c2e70 commit 2d8318b

File tree

21 files changed

+438
-104
lines changed

21 files changed

+438
-104
lines changed

.github/workflows/build_sdks.yaml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
ls build
6565
6666
build_macos_arm64:
67-
name: Compile MacOS-arm64
67+
name: Compile MacOS-Arm64
6868
runs-on: macos-14
6969

7070
steps:
@@ -89,7 +89,7 @@ jobs:
8989
ls build
9090
9191
build_armv7_armhf:
92-
name: Compile Armv7-armhf
92+
name: Compile Armv7-Armhf
9393
runs-on: ubuntu-latest
9494

9595
steps:
@@ -256,7 +256,7 @@ jobs:
256256
ls build
257257
258258
build_ios:
259-
name: Compile iOS-arm64
259+
name: Compile iOS-Arm64
260260
runs-on: macos-latest
261261

262262
steps:
@@ -302,7 +302,7 @@ jobs:
302302
ls build
303303
304304
build_armv7_rv1106_armhf_uclibc:
305-
name: Compile Linux-armv7 rv1106
305+
name: Compile Linux-Armv7 RV1106
306306
runs-on: ubuntu-latest
307307

308308
steps:
@@ -336,4 +336,42 @@ jobs:
336336
- name: Start Building the InspireFace-Linux-armv7-rv1106
337337
run: |
338338
bash command/build_cross_rv1106_armhf_uclibc.sh
339+
ls build
340+
341+
build_rk356x_aarch64:
342+
name: Compile Linux-AArch64 RK356X
343+
runs-on: ubuntu-latest
344+
345+
steps:
346+
# Step 1: Checkout the repository
347+
- name: Checkout Repository
348+
uses: actions/checkout@v4
349+
350+
# Step 2: Synchronize and update submodules recursively
351+
- name: Update submodules
352+
run: |
353+
git clone --recurse-submodules https://github.com/tunmx/inspireface-3rdparty.git 3rdparty
354+
355+
# Step 3: Install wget and xz-utils
356+
- name: Install wget and xz-utils
357+
run: |
358+
sudo apt-get update
359+
sudo apt-get install -y wget xz-utils
360+
361+
# Step 4: Download Toolchain
362+
- name: Download and Extract Linaro Toolchain
363+
run: |
364+
mkdir -p /opt/linaro-toolchain
365+
wget -qO- https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz | tar -xJ -C /opt/linaro-toolchain --strip-components=1
366+
367+
# Step 5: Install Toolchain
368+
- name: Set environment variables
369+
run: |
370+
echo "ARM_CROSS_COMPILE_TOOLCHAIN=/opt/linaro-toolchain" >> $GITHUB_ENV
371+
echo "PATH=/opt/linaro-toolchain/bin:${PATH}" >> $GITHUB_ENV
372+
373+
# Step 6: Start building the SDK
374+
- name: Start Building the InspireFace-Linux-AArch64-rk356x
375+
run: |
376+
bash command/build_cross_rk356x_aarch64.sh
339377
ls build
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build Linux-Ubuntu-AArch64-rk356x
2+
3+
on:
4+
push:
5+
branches: ["feature/rk356x"]
6+
7+
# Set the global GitHub token environment variable
8+
env:
9+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
10+
11+
jobs:
12+
build:
13+
name: Compile Linux-AArch64 RK356X
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
# Step 1: Checkout the repository
18+
- name: Checkout Repository
19+
uses: actions/checkout@v4
20+
21+
# Step 2: Synchronize and update submodules recursively
22+
- name: Update submodules
23+
run: |
24+
git clone --recurse-submodules https://github.com/tunmx/inspireface-3rdparty.git 3rdparty
25+
26+
# Step 3: Install wget and xz-utils
27+
- name: Install wget and xz-utils
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y wget xz-utils
31+
32+
# Step 4: Download Toolchain
33+
- name: Download and Extract Linaro Toolchain
34+
run: |
35+
mkdir -p /opt/linaro-toolchain
36+
wget -qO- https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz | tar -xJ -C /opt/linaro-toolchain --strip-components=1
37+
38+
# Step 5: Install Toolchain
39+
- name: Set environment variables
40+
run: |
41+
echo "ARM_CROSS_COMPILE_TOOLCHAIN=/opt/linaro-toolchain" >> $GITHUB_ENV
42+
echo "PATH=/opt/linaro-toolchain/bin:${PATH}" >> $GITHUB_ENV
43+
44+
# Step 6: Start building the SDK
45+
- name: Start Building the InspireFace-Linux-AArch64-rk356x
46+
run: |
47+
bash command/build_cross_rk356x_aarch64.sh
48+
ls build
49+

.github/workflows/release-sdks.yaml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,69 @@ jobs:
548548
path: |
549549
inspireface-macos-intel-x86-64-${{ env.VERSION }}.zip
550550
551+
build_rk356x_aarch64:
552+
name: Compile Linux-AArch64 RK356X
553+
runs-on: ubuntu-latest
554+
555+
steps:
556+
# Step 1: Checkout the repository
557+
- name: Checkout Repository
558+
uses: actions/checkout@v4
559+
560+
# Step 2: Extract the version number from the tag (e.g., "v1.2.3" becomes "1.2.3")
561+
- name: Extract Version Number
562+
id: extract_version
563+
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//')" >> $GITHUB_ENV
564+
565+
# Step 3: Synchronize and update submodules recursively
566+
- name: Update submodules
567+
run: |
568+
git clone --recurse-submodules https://github.com/tunmx/inspireface-3rdparty.git 3rdparty
569+
570+
# Step 4: Install wget and xz-utils
571+
- name: Install wget and xz-utils
572+
run: |
573+
sudo apt-get update
574+
sudo apt-get install -y wget xz-utils
575+
576+
# Step 5: Download Toolchain
577+
- name: Download and Extract Linaro Toolchain
578+
run: |
579+
mkdir -p /opt/linaro-toolchain
580+
wget -qO- https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz | tar -xJ -C /opt/linaro-toolchain --strip-components=1
581+
582+
# Step 6: Install Toolchain
583+
- name: Set environment variables
584+
run: |
585+
echo "ARM_CROSS_COMPILE_TOOLCHAIN=/opt/linaro-toolchain" >> $GITHUB_ENV
586+
echo "PATH=/opt/linaro-toolchain/bin:${PATH}" >> $GITHUB_ENV
587+
588+
# Step 7: Start building the SDK
589+
- name: Start Building the InspireFace-Linux-AArch64-rk356x
590+
run: |
591+
bash command/build_cross_rk356x_aarch64.sh
592+
ls build
593+
594+
# Step 7: Zip SDK directory
595+
- name: Zip SDK directory
596+
run: |
597+
cd build
598+
zip -r ../inspireface-linux-aarch64-rk356x-${{ env.VERSION }}.zip inspireface-linux-aarch64-rk356x-${{ env.VERSION }}
599+
cd ..
600+
stat inspireface-linux-aarch64-rk356x-${{ env.VERSION }}.zip
601+
602+
# Step 8: Upload the zipped SDK files for the next job
603+
- name: Upload SDK Artifacts
604+
uses: actions/upload-artifact@v4
605+
with:
606+
name: sdk_files_linux_aarch64_rk356x
607+
path: |
608+
inspireface-linux-aarch64-rk356x-${{ env.VERSION }}.zip
609+
551610
552611
release:
553612
name: Release SDKs to GitHub
554-
needs: [ build_linux_x86, build_armv7_armhf, build_armv7_rv1109rv1126_armhf, build_linux_aarch64, build_android, build_ios, build_manylinux2014_x86, build_armv7_rv1106_armhf_uclibc, build_macos_apple_silicon_arm64, build_macos_intel_x86_64]
613+
needs: [ build_linux_x86, build_armv7_armhf, build_armv7_rv1109rv1126_armhf, build_linux_aarch64, build_android, build_ios, build_manylinux2014_x86, build_armv7_rv1106_armhf_uclibc, build_rk356x_aarch64, build_macos_apple_silicon_arm64, build_macos_intel_x86_64]
555614
runs-on: ubuntu-latest
556615

557616
steps:
@@ -584,6 +643,7 @@ jobs:
584643
sdk_artifacts/sdk_files_armv7_armhf/inspireface-linux-armv7-armhf-${{ env.VERSION }}.zip
585644
sdk_artifacts/sdk_files_armv7_rv1109rv1126_armhf/inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}.zip
586645
sdk_artifacts/sdk_files_armv7_rv1106_armhf_uclibc/inspireface-linux-armv7-rv1106-armhf-uclibc-${{ env.VERSION }}.zip
646+
sdk_artifacts/sdk_files_linux_aarch64_rk356x/inspireface-linux-aarch64-rk356x-${{ env.VERSION }}.zip
587647
sdk_artifacts/sdk_files_linux_aarch64/inspireface-linux-aarch64-${{ env.VERSION }}.zip
588648
sdk_artifacts/sdk_files_android/inspireface-android-${{ env.VERSION }}.zip
589649
sdk_artifacts/sdk_files_ios/inspireface-ios-${{ env.VERSION }}.zip

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
1010
# Current version
1111
set(INSPIRE_FACE_VERSION_MAJOR 1)
1212
set(INSPIRE_FACE_VERSION_MINOR 1)
13-
set(INSPIRE_FACE_VERSION_PATCH 9)
13+
set(INSPIRE_FACE_VERSION_PATCH 10)
1414

1515
# Converts the version number to a string
1616
string(CONCAT INSPIRE_FACE_VERSION_MAJOR_STR ${INSPIRE_FACE_VERSION_MAJOR})
@@ -69,6 +69,12 @@ if (ISF_ENABLE_RKNN)
6969
endif()
7070
# Result
7171
message(STATUS "Use ${ISF_RKNPU_MAJOR}")
72+
73+
if(ISF_RK_DEVICE_TYPE STREQUAL "RV1106")
74+
set(ISF_RKNPU_RV1106 ON)
75+
add_definitions("-DISF_RKNPU_RV1106")
76+
endif()
77+
7278
endif ()
7379

7480
# Enable Rockchip RGA
@@ -288,6 +294,9 @@ if (ISF_ENABLE_RKNN)
288294
message(STATUS "\t ISF_RKNPU_MAJOR: ${ISF_RKNPU_MAJOR}")
289295
message(STATUS "\t ISF_RK_DEVICE_TYPE: ${ISF_RK_DEVICE_TYPE}")
290296
message(STATUS "\t ISF_RK_COMPILER_TYPE: ${ISF_RK_COMPILER_TYPE}")
297+
if(ISF_RKNPU_RV1106)
298+
message(STATUS "\t ISF_RKNPU_RV1106: ${ISF_RKNPU_RV1106}")
299+
endif()
291300
endif ()
292301
message(STATUS "\t ISF_BUILD_LINUX_ARM7: ${ISF_BUILD_LINUX_ARM7}")
293302
message(STATUS "\t ISF_BUILD_LINUX_AARCH64: ${ISF_BUILD_LINUX_AARCH64}")

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ Please contact [contact@insightface.ai](mailto:contact@insightface.ai?subject=In
1414

1515
## Change Logs
1616

17-
**`2024-12-22`** Started adapting for multiple Rockchip devices with NPU support, beginning with RV1106 support.
17+
**`2025-01-08`** Support inference on Rockchip devices **RK3566/RK3568** NPU.
18+
19+
**`2024-12-25`** Add support for optional **RKRGA** image acceleration processing on Rockchip devices.
20+
21+
**`2024-12-22`** Started adapting for multiple Rockchip devices with NPU support, beginning with **RV1103/RV1106** support.
1822

1923
**`2024-12-10`** Added support for quick installation via Python package manager.
2024

@@ -132,6 +136,8 @@ bash command/download_models_general.sh Megatron
132136
bash command/download_models_general.sh Gundam_RV1109
133137
# Download resource files for RV1106
134138
bash command/download_models_general.sh Gundam_RV1106
139+
# Download resource files for RK356X
140+
bash command/download_models_general.sh Gundam_RV356X
135141

136142
# Download all model files
137143
bash command/download_models_general.sh
@@ -227,9 +233,9 @@ We have completed the adaptation and testing of the software across various oper
227233
| 1 | **Linux-CPU** | ARMv7 | - | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
228234
| 2 | | ARMv8 | - | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
229235
| 3 | | x86/x86_64 | - | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | [![test](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/test_ubuntu_x86_Pikachu.yaml?style=for-the-badge&label=Test&color=blue)](https://github.com/HyperInspire/InspireFace/actions/workflows/test_ubuntu_x86_Pikachu.yaml) |
230-
| 4 | **Linux-Rockchip** | ARMv7 | RV1109RV1126 | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
231-
| 5 | | ARMv7 | RV1106 | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) |![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge)|
232-
| 6 | | ARMv8 | RK3566/RK3568 | ![build](https://img.shields.io/badge/build-developing-yellow?style=for-the-badge) | |
236+
| 4 | **Linux-Rockchip** | ARMv7 | RV1109/RV1126 | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
237+
| 5 | | ARMv7 | RV1103/RV1106 | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) |![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge)|
238+
| 6 | | ARMv8 | RK3566/RK3568 | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
233239
| 7 | | ARMv8 | RK3588 | ![build](https://img.shields.io/badge/build-developing-yellow?style=for-the-badge) | |
234240
| 8 | **Linux-CUDA** | x86/x86_64 | NVIDIA-GPU | ![build](https://img.shields.io/badge/OFFLINE-PASSING-green?style=for-the-badge) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
235241
| 9 | **MacOS** | Intel | CPU/Metal/**ANE** | [![build](https://img.shields.io/github/actions/workflow/status/HyperInspire/InspireFace/release-sdks.yaml?&style=for-the-badge&label=build)](https://github.com/HyperInspire/InspireFace/actions/workflows/release-sdks.yaml) | ![test](https://img.shields.io/badge/OFFLINE-PASSING-blue?style=for-the-badge) |
@@ -530,7 +536,8 @@ For different scenarios, we currently provide several Packs, each containing mul
530536
| Pikachu | CPU | Lightweight edge-side models | [Download](https://github.com/HyperInspire/InspireFace/releases/download/v1.x/Pikachu) |
531537
| Megatron | CPU, GPU | Mobile and server models | [Download](https://github.com/HyperInspire/InspireFace/releases/download/v1.x/Megatron) |
532538
| Gundam-RV1109 | RKNPU | Supports RK1109 and RK1126 | [Download](https://github.com/HyperInspire/InspireFace/releases/download/v1.x/Gundam_RV1109) |
533-
| Gundam-RV1106 | RKNPU | Supports RK1106(RV1103 may be supported, but not verified) | [Download](https://github.com/HyperInspire/InspireFace/releases/download/v1.x/Gundam_RV1106) |
539+
| Gundam-RV1106 | RKNPU | Supports RV1103 and RV1106 | [Download](https://github.com/HyperInspire/InspireFace/releases/download/v1.x/Gundam_RV1106) |
540+
| Gundam-RK356X | RKNPU | Supports RK3566 and RK3568 | [Download](https://github.com/HyperInspire/InspireFace/releases/download/v1.x/Gundam_RK356X) |
534541

535542
## Acknowledgement
536543

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
# Reusable function to handle 'install' directory operations
4+
move_install_files() {
5+
local root_dir="$1"
6+
local install_dir="$root_dir/install"
7+
8+
# Step 1: Check if the 'install' directory exists
9+
if [ ! -d "$install_dir" ]; then
10+
echo "Error: 'install' directory does not exist in $root_dir"
11+
exit 1
12+
fi
13+
14+
# Step 2: Delete all other files/folders except 'install'
15+
find "$root_dir" -mindepth 1 -maxdepth 1 -not -name "install" -exec rm -rf {} +
16+
17+
# Step 3: Move all files from 'install' to the root directory
18+
mv "$install_dir"/* "$root_dir" 2>/dev/null
19+
20+
# Step 4: Remove the empty 'install' directory
21+
rmdir "$install_dir"
22+
23+
echo "Files from 'install' moved to $root_dir, and 'install' directory deleted."
24+
}
25+
26+
if [ -n "$VERSION" ]; then
27+
TAG="-$VERSION"
28+
else
29+
TAG=""
30+
fi
31+
32+
33+
SCRIPT_DIR=$(pwd) # Project dir
34+
35+
36+
echo "MNN_CUSTOM_SOURCE: ${MNN_CUSTOM_SOURCE}"
37+
cd ${SCRIPT_DIR}
38+
39+
# export ARM_CROSS_COMPILE_TOOLCHAIN=/root/arm-rockchip830-linux-uclibcgnueabihf/
40+
41+
BUILD_FOLDER_PATH="build/inspireface-linux-aarch64-rk356x${TAG}"
42+
43+
mkdir -p ${BUILD_FOLDER_PATH}
44+
# shellcheck disable=SC2164
45+
cd ${BUILD_FOLDER_PATH}
46+
47+
# export ARM_CROSS_COMPILE_TOOLCHAIN=/host/software/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu
48+
49+
cmake -DCMAKE_SYSTEM_NAME=Linux \
50+
-DCMAKE_BUILD_TYPE=Release \
51+
-DCMAKE_SYSTEM_VERSION=1 \
52+
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
53+
-DCMAKE_C_COMPILER=$ARM_CROSS_COMPILE_TOOLCHAIN/bin/aarch64-linux-gnu-gcc \
54+
-DCMAKE_CXX_COMPILER=$ARM_CROSS_COMPILE_TOOLCHAIN/bin/aarch64-linux-gnu-g++ \
55+
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -flax-vector-conversions" \
56+
-DTARGET_PLATFORM=armlinux \
57+
-DISF_BUILD_LINUX_AARCH64=ON \
58+
-DISF_BUILD_LINUX_ARM7=OFF \
59+
-DMNN_SEP_BUILD=off \
60+
-DISF_ENABLE_RKNN=ON \
61+
-DISF_RK_DEVICE_TYPE=RK356X \
62+
-DISF_RKNPU_MAJOR=rknpu2 \
63+
-DISF_RK_COMPILER_TYPE=aarch64 \
64+
-DISF_ENABLE_RGA=ON \
65+
-DISF_ENABLE_COST_TIME=OFF \
66+
-DISF_BUILD_WITH_SAMPLE=OFF \
67+
-DISF_BUILD_WITH_TEST=OFF \
68+
-DISF_ENABLE_BENCHMARK=OFF \
69+
-DISF_ENABLE_USE_LFW_DATA=OFF \
70+
-DISF_ENABLE_TEST_EVALUATION=OFF \
71+
-DISF_BUILD_SHARED_LIBS=OFF ${SCRIPT_DIR}
72+
73+
make -j4
74+
make install
75+
76+
move_install_files "$(pwd)"

0 commit comments

Comments
 (0)