diff --git a/ci/build_aar.sh b/ci/build_aar.sh index 5fb34db..ad1809b 100755 --- a/ci/build_aar.sh +++ b/ci/build_aar.sh @@ -14,7 +14,7 @@ MY_ANDROID_HOME="${ANDROID_HOME:-$HOME/Android/Sdk}" MY_ANDROID_NDK_HOME="${ANDROID_NDK_HOME:-$MY_ANDROID_HOME/ndk-bundle}" JNI_BUILD_DIR=build_jni_tmp rm -rf ${JNI_BUILD_DIR} && mkdir ${JNI_BUILD_DIR} && pushd ${JNI_BUILD_DIR} -cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_TOOLCHAIN_FILE=${MY_ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake -DANDROID_CPP_FEATURES=exceptions -DANDROID_PLATFORM=android-21 -DANDROID_ABI=arm64-v8a -DBNN_BUILD_JNI=ON -DBNN_BUILD_TEST=OFF -DBNN_BUILD_BENCHMARK=OFF .. +cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_TOOLCHAIN_FILE=${MY_ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake -DANDROID_CPP_FEATURES=exceptions -DANDROID_PLATFORM=android-27 -DANDROID_ABI=arm64-v8a -DBNN_BUILD_JNI=ON -DBNN_BUILD_TEST=OFF -DBNN_BUILD_BENCHMARK=OFF .. cmake --build . -- -j$nproc popd mkdir -p ci/android_aar/dnnlibrary/src/main/jniLibs/arm64-v8a diff --git a/ci/build_dnnlibrary.sh b/ci/build_dnnlibrary.sh index b23a83e..20ddbbf 100755 --- a/ci/build_dnnlibrary.sh +++ b/ci/build_dnnlibrary.sh @@ -4,7 +4,7 @@ set -e echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'ndk-bundle' nproc=$(ci/get_cores.sh) -mkdir build_dnnlibrary && cd build_dnnlibrary -cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release .. +mkdir build_dnnlibrary && pushd build_dnnlibrary +cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DDNN_READ_ONNX=ON .. cmake --build . -- -j$nproc -cd - +popd diff --git a/ci/dnnlibrary_build_and_test.yml b/ci/dnnlibrary_build_and_test.yml index 812f95d..0ef0ae7 100644 --- a/ci/dnnlibrary_build_and_test.yml +++ b/ci/dnnlibrary_build_and_test.yml @@ -33,14 +33,8 @@ steps: displayName: Build - bash: ci/start_android_emulator.sh displayName: Start Android Emulator -- bash: ci/adb_push_and_run.sh build_dnnlibrary/tests/bconv_test - displayName: Binary Conv Test -- bash: ci/adb_push_and_run.sh build_dnnlibrary/tests/bgemm_test - displayName: Binary Gemm Test -- bash: ci/download_models.sh - displayName: Download Models -- bash: ci/adb_push_and_run.sh build_dnnlibrary/tests/net_test - displayName: Model Test +- bash: ci/download_and_test_models.sh + displayName: Download Models And Test - bash: ci/build_aar.sh env: BINTRAY_KEY: $(bintrayKey) diff --git a/ci/download_and_test_models.sh b/ci/download_and_test_models.sh new file mode 100755 index 0000000..6c2a559 --- /dev/null +++ b/ci/download_and_test_models.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +set -e + +wget "https://s3.amazonaws.com/onnx-model-zoo/squeezenet/squeezenet1.1/squeezenet1.1.tar.gz" -O squeezenet1.1.tar.gz +tar xvf squeezenet1.1.tar.gz +python3 ci/validate_onnx.py squeezenet1.1 build_dnnlibrary/binaries/dnn_retrieve_result + +wget "https://s3.amazonaws.com/onnx-model-zoo/mobilenet/mobilenetv2-1.0/mobilenetv2-1.0.tar.gz" -O mobilenetv2-1.0.tar.gz +tar xvf mobilenetv2-1.0.tar.gz +python3 ci/validate_onnx.py mobilenetv2-1.0 build_dnnlibrary/binaries/dnn_retrieve_result + +wget "https://s3.amazonaws.com/onnx-model-zoo/resnet/resnet18v2/resnet18v2.tar.gz" -O resnet18v2.tar.gz +tar xvf resnet18v2.tar.gz +python3 ci/validate_onnx.py resnet18v2 build_dnnlibrary/binaries/dnn_retrieve_result + +wget "https://s3.amazonaws.com/download.onnx/models/opset_9/bvlc_googlenet.tar.gz" -O bvlc_googlenet.tar.gz +tar xvf bvlc_googlenet.tar.gz +python3 ci/validate_onnx.py bvlc_googlenet build_dnnlibrary/binaries/dnn_retrieve_result + diff --git a/ci/download_models.sh b/ci/download_models.sh deleted file mode 100755 index bce81e7..0000000 --- a/ci/download_models.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env bash - -wget "https://drive.google.com/uc?export=download&id=1FYqF5BvYO2kl13bn28sheKtgverkbbQN" -O model_imagenet.dab -adb push model_imagenet.dab /data/local/tmp -wget "https://drive.google.com/uc?export=download&id=1frtRL1O0zhtJvPFbhE8COFl1-WWHIaOW" -O model_imagenet_stem.dab -adb push model_imagenet_stem.dab /data/local/tmp/ diff --git a/validate_onnx.py b/ci/validate_onnx.py similarity index 100% rename from validate_onnx.py rename to ci/validate_onnx.py