diff --git a/README.md b/README.md index fd441ea..b4edaee 100644 --- a/README.md +++ b/README.md @@ -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. + diff --git a/examples/build-android-all.sh b/examples/build-android-all.sh index 95d24d9..f273101 100755 --- a/examples/build-android-all.sh +++ b/examples/build-android-all.sh @@ -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 diff --git a/examples/clean-android-all.sh b/examples/clean-android-all.sh new file mode 100755 index 0000000..fad1ed5 --- /dev/null +++ b/examples/clean-android-all.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# +# Copyright (C) 2024–2025 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." diff --git a/examples/clip/README.md b/examples/clip/README.md index 7b8a6e5..f8f5ebd 100644 --- a/examples/clip/README.md +++ b/examples/clip/README.md @@ -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`. diff --git a/examples/mobilenet/README.md b/examples/mobilenet/README.md index b4a9324..e65a0b4 100644 --- a/examples/mobilenet/README.md +++ b/examples/mobilenet/README.md @@ -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). diff --git a/examples/ppocr-det/README.md b/examples/ppocr-det/README.md index a1f1540..fbeb79a 100644 --- a/examples/ppocr-det/README.md +++ b/examples/ppocr-det/README.md @@ -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/`. diff --git a/examples/resnet/README.md b/examples/resnet/README.md index f24f6d7..defa581 100755 --- a/examples/resnet/README.md +++ b/examples/resnet/README.md @@ -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). diff --git a/examples/retinaface/README.md b/examples/retinaface/README.md index 7a47df0..1f732b4 100755 --- a/examples/retinaface/README.md +++ b/examples/retinaface/README.md @@ -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). diff --git a/examples/whisper/README.md b/examples/whisper/README.md index 91103b1..cc96ec1 100644 --- a/examples/whisper/README.md +++ b/examples/whisper/README.md @@ -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/`. diff --git a/examples/yoloe/README.md b/examples/yoloe/README.md index 2a7d192..b33f6d8 100644 --- a/examples/yoloe/README.md +++ b/examples/yoloe/README.md @@ -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/`. diff --git a/examples/yolov11/README.md b/examples/yolov11/README.md index 79fff22..2558b9e 100755 --- a/examples/yolov11/README.md +++ b/examples/yolov11/README.md @@ -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). diff --git a/examples/yolov8/README.md b/examples/yolov8/README.md index 43d1c97..c4f0d08 100644 --- a/examples/yolov8/README.md +++ b/examples/yolov8/README.md @@ -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). diff --git a/examples/yoloworld/README.md b/examples/yoloworld/README.md index 0c6c126..8293378 100644 --- a/examples/yoloworld/README.md +++ b/examples/yoloworld/README.md @@ -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).