Sources: * https://github.com/mlperf/inference/tree/master/v0.5/classification_and_detection/optional_harness_ck/classification This CK solution demo was prepared by Grigori Fursin and Hervé Guillou. Requred Ubuntu packages: sudo apt update sudo apt install git wget libz-dev curl cmake sudo apt install gcc g++ autoconf autogen libtool Android SDK and NDK: sudo apt install android-sdk sudo apt install google-android-ndk-installer We tested the solution with Android NDK GCC though LLVM should work too ... ======================== The tricky part if you use Windows with Ubuntu virtual machine (we plan to automate in the future). You need to first connect your Android device via adb on Windows and then use adb in Linux to connect to Windows adb server. In such case you need to make sure that both adb version are the same! For example, you can test adb version on Windows as follows: C:> adb version Android Debug Bridge version version 1.0.41 Then on Linux: adb version Android Debug Bridge version 1.0.39 Since versions are different, we should install correct adb version on Linux into the Python environment of this solution: wget https://dl.google.com/android/repository/platform-tools_r29.0.3-linux.zip unzip platform-tools_r29.0.3-linux.zip cd platform-tools mv * ../venv/bin cd .. Now check that adb version is correct: which adb adb version > Android Debug Bridge version 1.0.41 > Version 29.0.3-5806383 If you don't see devices, kill the adb server in Linux: adb kill-server Start it in Windows C:> adb start-server And then check devices: adb devices ======================== Finally, add adb to the CK env: $ ck detect soft:tool.adb --full_path=$PWD/venv/bin/adb
pip3 install cbench or python3 -m pip install cbench or pip install cbench
cb init demo-image-classification-tflite-cpu-mobilenets-linux-android
cb run demo-image-classification-tflite-cpu-mobilenets-linux-android # Note that the following CK program pipeline will be executed: ck compile program:image-classification-tflite-codereef-android --cmd_key=default --speed ck run program:image-classification-tflite-codereef-android --cmd_key=default
pip install numpy pip install opencv-python ck pull repo:ck-mlperf ck install package --tags=lib,python-package,numpy ck install package --tags=lib,python-package,cv2 ck install package:imagenet-2012-val-min ck install package:imagenet-2012-aux ck install package:lib-rtl-xopenme ck install package:dataset-imagenet-preprocessed-using-opencv ck install package --tags=lib,tflite,v1.13.1,vsrc --target_os=android23-arm64 ck install package:model-tf-mlperf-mobilenet-quantized ck compile program:image-classification-tflite-codereef-android --speed --target_os=android23-arm64