commit | 7985194add91f678628a3390bcdd6d6e03f85ddb | [log] [tgz] |
---|---|---|
author | Dmitry Kovalev <dkovalev@google.com> | Tue May 04 19:43:32 2021 -0700 |
committer | Dmitry Kovalev <dkovalev@google.com> | Tue May 04 19:43:32 2021 -0700 |
tree | eedd941daec63a280576d6a792bcf25f37af9484 | |
parent | 8a05bdd7eae23ea10cbc9c8b23181f3fb7c808b2 [diff] |
Update project structure and README.md Change-Id: Ia0d3f878163c9a1d850d750b0def972aae11970e
This is a project to demonstrate how to access Coral USB Accelerator from Chrome browser using WebUSB. The demo works on Linux and macOS.
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
.
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.
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.