Skip to content

Image Classification Example

This application instantiates the MLPerf Image Classification benchmark model using TFLM, runs a set of included images through it, and sends the results of the classification to a javascript application via WebUSB. The Image Classification model code was autogenerated by Autodeploy.

Relevant neuralSPOT Documents

WebUSB neuralSPOT Library

Guide to using Autodeploy

Running The Demo

The IC example classifies pre-canned images and sends the result over USB to a javascript application. This application then displays the image and the classification result.

  1. Connect both USB interfaces on the EVB to a PC
  2. Connect the camera to the EVB (wiring is describe in Camera doc, linked above)
  3. Install a browser with WebUSB support (Chrome and Edge are known to work)
  4. Compile and flash the example
  5. Click on the browser notification announcing the presence of a WebUSB device - this will load the example's companion website.

Understanding the Code

examples.h                    # 100 image tensors
ic.cc                         # The main application
ic_bench_api.h                # Generated by Autodeploy based on MLPerf's TFLite
ic_bench_example_tensors.h    # not used
ic_bench_model.cc             # Autodeploy's TFLite wrapper for IC
ic_bench_model.h              # Autodeploy's metadata for IC
ic_bench_model_data.h         # IC weights
ns_model.h                    # neuralSPOT generic TFLite wrapper