• Stars
    star
    170
  • Rank 222,047 (Top 5 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Source code for the userspace level runtime driver for Coral.ai devices.

Edge TPU runtime library (libedgetpu)

This repo contains the source code for the userspace level runtime driver for Coral devices. This software is distributed in the binary form at coral.ai/software.

Building

There are three ways to build libedgetpu:

  • Docker + Bazel [Recommended]: Compatible with Linux, MacOS and Windows (via Dockerfile.windows and build.bat), this method ensures a known-good build enviroment and pulls all external depedencies needed.
  • Bazel: Supports Linux, macOS, and Windows (via build.bat). A proper enviroment setup is required before using this technique.
  • Makefile: Supporting only Linux and Native builds, this strategy is pure Makefile and doesn't require Bazel or external dependencies to be pulled at runtime.

Bazel + Docker

Build Linux binaries inside Docker container (works on Linux and macOS):

$ DOCKER_CPUS="k8" DOCKER_IMAGE="ubuntu:18.04" DOCKER_TARGETS=libedgetpu make docker-build
$ DOCKER_CPUS="armv7a aarch64" DOCKER_IMAGE="debian:stretch" DOCKER_TARGETS=libedgetpu make docker-build

All built binaries go to the out directory. Note that the bazel-* are not copied to the host from the Docker container.

Bazel

For proper environment setup check docker directory.

Build native binaries on Linux and macOS:

$ make

Build native binaries on Windows:

$ build.bat

Cross-compile for ARMv7-A (32 bit), and ARMv8-A (64 bit) on Linux:

$ CPU=armv7a make
$ CPU=aarch64 make

Makefile

If only building for native systems, it is possible to significantly reduce the complexity of the build by removing Bazel (and Docker). This simple approach builds only what is needed, removes build-time depenency fetching, increases the speed, and uses upstream Debian packages.

To prepare your system, you'll need the following packages (both available on Debian Bullseye or Buster-Backports):

sudo apt install libabsl-dev libflatbuffers-dev

Next, you'll need to clone the Tensorflow Repo at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.5, we can check that tag in the TF Repo and then checkout that address:

git clone https://github.com/tensorflow/tensorflow
git checkout a4dfb8d1a71385bd6d122e4f27f86dcebb96712d -b tf2.5

To build the library:

TFROOT=<Directory of Tensorflow> make -f makefile_build/Makefile -j$(nproc) libedgetpu

Support

If you have question, comments or requests concerning this library, please reach out to [email protected].

License

Apache License 2.0

Warning

If you're using the Coral USB Accelerator, it may heat up during operation, depending on the computation workloads and operating frequency. Touching the metal part of the USB Accelerator after it has been operating for an extended period of time may lead to discomfort and/or skin burns. As such, if you enable the Edge TPU runtime using the maximum operating frequency, the USB Accelerator should be operated at an ambient temperature of 25°C or less. Alternatively, if you enable the Edge TPU runtime using the reduced operating frequency, then the device is intended to safely operate at an ambient temperature of 35°C or less.

Google does not accept any responsibility for any loss or damage if the device is operated outside of the recommended ambient temperature range.

Note: This issue affects only USB-based Coral devices, and is irrelevant for PCIe devices.

More Repositories

1

project-posenet

Human Pose Detection on EdgeTPU
Python
544
star
2

edgetpu

Coral issue tracker (and legacy Edge TPU API source)
C++
411
star
3

examples-camera

Small code snippets that show how to stream camera images to a Coral device.
Python
346
star
4

pycoral

Python API for ML inferencing and transfer-learning on Coral devices
Python
336
star
5

project-bodypix

BodyPix model demo application for Google Coral
Python
272
star
6

tflite

Examples using TensorFlow Lite API to run inference on Coral devices
Python
180
star
7

tutorials

Colab/Jupyter tutorials about training TensorFlow models for Edge TPU, and other tutorials
Jupyter Notebook
171
star
8

project-keyword-spotter

Audio Keyphrase Detector
Python
133
star
9

example-object-tracker

Python
104
star
10

coralmicro

Source code for Coral Dev Board Micro
C++
95
star
11

edgetpu-platforms

EdgeTPU support for other platforms, specifically Raspberry Pi Zero
Shell
75
star
12

libcoral

C++ API for ML inferencing and transfer-learning on Coral devices
C++
72
star
13

project-teachable-sorter

Python
48
star
14

test_data

Trained and compiled TF Lite models, and other testing data for Coral devices
Starlark
43
star
15

project-birdfeeder

Python
38
star
16

webcoral

JavaScript
33
star
17

project-banana-robo

Python
29
star
18

project-teachable

Example Project: Teachable Machine
Python
26
star
19

electricals

Electrical designs for coral.ai projects
HTML
26
star
20

crosstool

Starlark
19
star
21

example-multiple-edgetpus

C++
14
star
22

project-cloud-monitor

Python
12
star
23

demo-manufacturing

C++
11
star
24

aiy-maker-kit

Simple Python API for ML inferencing with TF Lite and Coral Edge TPU
Python
9
star
25

imprinting-training

Imprinting training scripts of tensorflow.
Python
9
star
26

aiy-maker-kit-tools

Build scripts to create RPI OS system image for AIY Maker Kit
Python
6
star
27

mechanicals

Reference mechanical designs for coral.ai projects
5
star
28

py-repo

Python
4
star
29

demo-multi-video-stream

Demo showcasing processing multiple videostreams in parallel on system with 8 EdgeTPUs
C++
3
star
30

coralmicro-out-of-tree-sample

C++
2
star
31

coralmicro-littlefs-fuse

C
1
star