This repo is used to test the speed of the mobile terminal models with NCNN
- NCNN: ncnn-20201218-android-vulkan
-
Download ncnn-20201218-android-vulkan.zip or build ncnn for android yourself
-
Extract
ncnn-20201218-android-vulkan.zip
intoapp/src/main/jni
or change the ncnn_DIR path to yours inapp/src/main/jni/CMakeLists.txt
-
Open this project with Android Studio, download model param and extract into
app/src/assets
-
Add input shape for
Input
layer7767517 227 252 Input data 0 1 data -23330=4,3,320,320,3 0=320 1=320 2=3 Convolution Conv_0 1 1 data 940 0=24 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=648 ReLU LeakyRelu_1 1 1 940 424 0=1.000000e-01
-
Register all your model
output head
inapp/src/main/jni/model_head.h
and add your model inapp/src/main/jni/benchmarkncnn_jni.cpp
-
Run android project and enjoy it !
[email protected]:nihui/ncnn-android-benchmark.git