Skip to content
Google Coral on the Raspberry Pi 4
Python Shell
Branch: master
Clone or download
Latest commit 97ce269 Jul 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Delete Jul 19, 2019 Update Jul 19, 2019


Google Coral on the Raspberry Pi 4

Video up on youtube

Update 3 July 2019

I have written a live object detection script (see src/ This is similar to the scripts I used with the NCS2, but for the Coral TPU. It is a test script, so models and labels are hardcoded. I wanted to it be as close to the original scripts I wrote for the NCS in order to do a fair comparison.

So far, I am getting over 36FPS video and over 36FPS inferencing on a single TPU! I will do a proper test in the daylight. Room lights at night are not sufficient.


Update 4 July 2019

I have written another object detection script for video files (see src/ Since we can push video through the loop as fast as we can, it is possible to get 70fps and still do reasonable inferencing!


Getting the Coral to work with the Pi 4

The Google Coral Edge TPU device can be made to work with the Raspberry Pi 4

As per the instructions at:

wget -O edgetpu_api.tar.gz --trust-server-names
tar xzf edgetpu_api.tar.gz
cd edgetpu_api

REPLACE with the one I have in src

THEN run the script ;-)

Note, when you run the demos, instead of here: /usr/local/lib/python3.5/dist-packages/edgetpu/demo

you need to be here!: /usr/local/lib/python3.7/dist-packages/edgetpu/demo

This script does a number of things:


  elif [[ "${MODEL}" == "Raspberry Pi 4 Model B Rev"* ]]; then #edit for rpi4
    info "Recognized as Raspberry Pi 4."

Fixed this (which caused the script to bomb with "Need To Be Root":

sudo udevadm control --reload-rules && udevadm trigger

to this:

sudo udevadm control --reload-rules && sudo udevadm trigger  #needed to put sudo in second half of command...

Finally as Raspian buster uses python 3.7 added:

if [[ "${MODEL}" == "Raspberry Pi 4 Model B Rev"* ]]; then #edit for rpi4
   info "Lib Fu."
   sudo cp /usr/local/lib/python3.7/dist-packages/edgetpu/swig/ /usr/local/lib/python3.7/dist-packages/edgetpu/swig/

Note, all this does is copy the python wrapper (compiled for python 3.5) and use 37 instead of 35 in the filename. Terrible undiscovered things may happen, or they may not, but it all seems to work for me!

All the examples supplied in the packages appear to work correctly.

You can’t perform that action at this time.