feat: Introduce clean-android-all.sh and refine Android build documentation and scripts for AMLNN SDK dependency.

This commit is contained in:
dian.yuan 2026-02-24 20:10:11 +08:00
parent 21105e3db7
commit b285b41a98
13 changed files with 53 additions and 153 deletions

View file

@ -93,12 +93,24 @@ modelzoo/
Clone it with:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
git clone https://github.com/Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
Each **example** directory contains a **build-android.sh** and build-linux.sh **script**. For compilation steps, refer to **Chapter 4** of the **README.md** file in the corresponding example directory.
Each **example** directory contains a **build-android.sh** and **build-linux.sh** script. For compilation steps, refer to **Chapter 4** of the **README.md** file in the corresponding example directory.
To build **all examples at once**, use the top-level batch script:
```bash
cd examples
./build-android-all.sh # auto-detects amlnn-toolkit (Priority 3)
# or explicitly:
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android-all.sh
```
The script automatically cleans the previous build, resolves the AMLNN SDK via the priority rules above, and prints a build summary at the end.

View file

@ -72,7 +72,7 @@ else
echo " ./build-android-all.sh"
echo ""
echo " Option B clone amlnn-toolkit as a sibling directory:"
echo " git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../../../amlnn-toolkit"
echo " git clone https://github.com/Amlogic-NN/amlnn-toolkit.git ../../amlnn-toolkit"
echo " ./build-android-all.sh"
echo ""
exit 1

28
examples/clean-android-all.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
#
# Copyright (C) 20242025 Amlogic, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
SCRIPT_DIR=$(cd "$(dirname $0)" && pwd)
echo "Cleaning all Android build directories..."
find "${SCRIPT_DIR}" -type d -name "build" | while read dir; do
echo " rm -rf ${dir}"
rm -rf "${dir}"
done
echo "Done."

View file

@ -18,20 +18,6 @@ TO DO
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -40,7 +26,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/clip/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android_arm64-v8a/clip_demo`.

View file

@ -16,20 +16,6 @@ for deployment on Amlogic NPU platforms.
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -38,7 +24,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/mobilenet/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android/mobilenet_v2_demo` (Note: executable name may vary, verify in build folder).

View file

@ -6,20 +6,6 @@
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK r25c
- `ANDROID_NDK_PATH` environment variable set
@ -28,7 +14,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/ppocr-det/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated in `build/android/`.

View file

@ -61,20 +61,6 @@ example
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -83,7 +69,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/resnet/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android/resnet_demo` (Note: executable name may vary, verify in build folder).

View file

@ -58,20 +58,6 @@ example
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -80,7 +66,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/retinaface/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android/retinaface_demo` (Note: executable name may vary, verify in build folder).

View file

@ -6,20 +6,6 @@
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK r25c
- `ANDROID_NDK_PATH` environment variable set
@ -28,7 +14,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/whisper/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated in `build/android/`.

View file

@ -6,20 +6,6 @@
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK r25c
- `ANDROID_NDK_PATH` environment variable set
@ -28,7 +14,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/yoloe/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated in `build/android/`.

View file

@ -70,20 +70,6 @@ example
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -92,7 +78,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/yolov11/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android/yolo11_demo` (Note: executable name may vary, verify in build folder).

View file

@ -70,20 +70,6 @@ example
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -92,7 +78,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/yolov8/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android/yolov8_demo` (Note: executable name may vary, verify in build folder).

View file

@ -4,20 +4,6 @@
#### 1. Compile
#### AMLNN SDK Setup
Resolve the AMLNN nnsdk dependency using one of the following methods:
- **Priority 1 Environment variable (recommended)**
```bash
export AMLNN_HOME=/path/to/amlnn-toolkit
```
- **Priority 3 Sibling directory fallback** *(automatic)*
Place `amlnn-toolkit` as a sibling to `amlnn-model-playground`:
```bash
git clone git@github.com:Amlogic-NN/amlnn-toolkit.git ../amlnn-toolkit
```
**Prerequisites:**
- Android NDK (r25e recommended)
- `ANDROID_NDK_PATH` environment variable set
@ -26,7 +12,7 @@ Resolve the AMLNN nnsdk dependency using one of the following methods:
```bash
# Build for arm64-v8a
cd examples/yoloworld/cpp
./build-android.sh -a arm64-v8a
AMLNN_HOME=/path/to/amlnn-toolkit ./build-android.sh -a arm64-v8a
```
The executable will be generated at `build/android/yolo_world_demo` (Note: executable name may vary, verify in build folder).