Check the preview of 2nd version of this platform being developed by the open MLCommons taskforce on automation and reproducibility as a free, open-source and technology-agnostic on-prem platform.

Image classification • MLPerf inference • TFLite CPU • Mobilenets • Raspberry Pi 4 • webcam

solution:demo-image-classification-tflite-cpu-mobilenets-rpi4 (v1.5.0)

Portable solution description  

Install and run this solution on your platform in several simple steps. Our goal is to make it simpler to reproduce results from research papers, participate in crowd-benchmarking, and enable "live" papers.
Don't hesitate to get in touch if you encounter any issues or would like to discuss this community project!

Check the prerequisites for your system  

Install manually from the command line (to be automated in the future):

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

For OpenCV:
 sudo apt install python-opencv
 sudo apt install libatlas-base-dev
 sudo apt install libjasper-dev
 sudo apt install libhdf5-dev
 sudo apt install libhdf5-serial-dev
 sudo apt install libqtgui4 
 sudo apt install libqt4-test

Install cBench (docs)

Install cBench from the command line (a small Python library to manage CK solutions):
pip3 install cbench
python3 -m pip install cbench
pip install cbench 
Note that you may need to add the --user flag if you install in your user space, i.e. "python3 -m pip install cbench --user"

Init this solution with the portable workflow on your machine

Run manually from your command line (cBench will attempt to automatically adapt this workflow to your system - you may need to press Enter several times to select default answers for some questions):
cb init demo-image-classification-tflite-cpu-mobilenets-rpi4

Start cBench (status: disconnected)

cb start

Run this workflow locally

or start local run manually from the command line:
cb run demo-image-classification-tflite-cpu-mobilenets-rpi4

  # Note that the following CK program pipeline will be executed:
  ck compile program:image-classification-tflite-codereef --cmd_key=default --speed
  ck run program:image-classification-tflite-codereef --cmd_key=default

Live test of this workflow via your browser

Successfully tested configuration

Host OS: linux-32 (Raspbian GNU/Linux 10 (buster))
Target OS: linux-32 (Raspbian GNU/Linux 10 (buster))
Target machine: Raspberry (Raspberry Pi 4 Model B Rev 1.1)
Target CPU: BCM2835
Target CPUs:
Python version for virtual env: 3.7.3


Reused CK components

These components are automatically installed by cBench from this portal:
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

ck install package:model-tf-mlperf-mobilenet-quantized

ck compile program:image-classification-tflite-codereef --speed


Please log in to add your comments!
If you notice any inapropriate content that should not be here, please report us as soon as possible and we will try to remove it within 48 hours!