# Tested on Ubuntu 18.04 # (including Docker and Windows 10 Sybsystem for Linux) # These dependencies are needed to cross-compile for Android and rebuild COCO API: # We tested this solution with the Android NDK GCC though LLVM should work too! 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 ###### Extra notes ###### The installation is a bit trickier if you use Windows with Ubuntu Subsystem - we plan to automate it in the future! First, you need to 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-obj-detection-coco-tflite-cpu-benchmark-android-portable-workflows
cb benchmark demo-obj-detection-coco-tflite-cpu-benchmark-android-portable-workflows
cb run demo-obj-detection-coco-tflite-cpu-benchmark-android-portable-workflows # Note that the following CK program pipeline will be executed: ck compile program:object-detection-tflite-benchmark --cmd_key=default --speed ck run program:object-detection-tflite-benchmark --cmd_key=default
cb download --version=1.0.0 --force program:object-detection-tflite-benchmark --all cb download --version=1.0.0 --force package:model-tf-mlperf-ssd-mobilenet --all cb download --version=1.0.0 compiler:gcc* ck install package:lib-tflite-1.13.1-src-static --target_os=android23-arm64 ck install package --tags=model,tf,object-detection,mlperf,ssd-mobilenet,non-quantized ck install package --tags=lib,python-package,numpy ck install package --tags=lib,python-package,scipy --force_version=1.2.1 ck install package --tags=lib,python-package,matplotlib ck install package --tags=lib,python-package,pillow ck install package --tags=lib,python-package,cython ck install package --tags=lib,python-package,cv2,opencv-contrib-python --force_version=3.4.3.18 ck install package:lib-tflite-1.13.1-src-static --target_os=android23-arm64 ck install package:tool-coco-codereef ck install package:dataset-coco-2017-val-small ck compile program:object-detection-tflite-benchmark --speed --target_os=android23-arm64