Update project structure and README.md

Change-Id: Ia0d3f878163c9a1d850d750b0def972aae11970e
12 files changed
tree: eedd941daec63a280576d6a792bcf25f37af9484
  1. docker/
  2. scripts/
  3. site/
  4. tflite/
  5. third_party/
  6. .gitignore
  7. .gitmodules
  10. Makefile
  11. README.md


This is a project to demonstrate how to access Coral USB Accelerator from Chrome browser using WebUSB. The demo works on Linux and macOS.

Web Server Setup

Clone this repo with submodules:

git clone --recurse-submodules https://github.com/google-coral/webcoral

Switch directory:

cd webcoral

Download .tflite model files to site/models:

make download

Build WASM files inside Docker container:

DOCKER_SHELL_COMMAND="make wasm" make docker-shell

Run local web server using python:

make server

Server is listening on port 8000.

System Setup

On Linux you need to install device rules to make Coral USB device visible in Chrome. You probably already have them installed if you are using Coral products. Just in case this repo has a bash script right for that:

scripts/linux_device_rules.sh install

and corresponding uninstall command if needed:

scripts/linux_device_rules.sh uninstall

On macOS you don't need to install anything.

Device Setup

Coral USB accelerator doesn‘t have preinstalled firmware. If you run lsusb command right after plugging USB device in, you’ll see

Bus 001 Device 008: ID 1a6e:089a Global Unichip Corp.

This means firmware is not flashed yet. It is possible to flash firmware directly from Chrome or from command line. Either way after flashing you'll see:

Bus 001 Device 009: ID 18d1:9302 Google Inc.

which means that device is ready to use.

To flash firmware from command line:

make reset

To flash from Chrome browser, point it to http://localhost:8000/ and press Flash Device Firmware button. WARNING: this only works on Linux now. There is an issue on macOS. It is already fixed and the fix will be available in Chrome 91.


Make sure the USB device was properly flashed. Choose the model you like to run and press Initialize Interpreter button. TPU model will require to select USB device in the dialog. CPU model will be ready immediately. At this moment you can run inference on any local image file by pressing Choose Image File button.