You can greatly increase the inference speed by using a Google Coral USB Accelerator.
Your best bet is to follow the official getting started guide, but I will document the process here as well.
If you are brave, try running carl --setup-coral
to have Carl assist you with this setup. If this does not work, try the manual steps below.
You can follow these instructions, or try my steps below.
NOTE: You must use python version 3.5-3.8 or pycoral
will not install completely. Follow the instructions in the README.md to install the correct version of python.
- Ensure you have either
homebrew
ormacports
installed. - Download and unpack the Edge TPU runtime:
curl -LO https://github.com/google-coral/libedgetpu/releases/download/release-frogfish/edgetpu_runtime_20210119.zip unzip edgetpu_runtime_20210119.zip
- Install the Edge TPU runtime. You will be required to enter your password. Select "No" when prompted to enable maximum operating frequency.
cd edgetpu_runtime sudo bash install.sh
- Install PyCoral into the virtual environment where Carl lives.
- If you followed the
git
install:- Activate your virtual environment (steps vary depending on how you manage your environment).
- Run the following to install pycoral:
python -m pip install --extra-index-url https://google-coral.github.io/py-repo/ pycoral
- If you followed the
pipx
install:- Run the following to install pycoral into
carl
s virtual environment:pipx inject housecarl pycoral --pip-args "--extra-index-url https://google-coral.github.io/py-repo/"
- Run the following to install pycoral into
- If you followed the
- Plug the USB Accelerator into your computer using a USB 3.0 cable.
If you are brave, try running carl --setup-coral
to have Carl assist you with this setup. If this does not work, try the manual steps below.
Follow the official instructions here, or try my manual steps below.
If you are installing this on a Raspberry Pi, make sure that you are using python 3.7. Later versions require a version of lib6c that is not supported on the Pi.
- Add Google's package repository to the system:
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo apt-get update
- Install the Edge TPU Runtime:
sudo apt-get install libedgetpu1-std
- Install PyCoral into your virtual environment. This is where my steps differ from the official documentation. Again, make sure you are using python 3.7.
- With your virtualenv activated, install pycoral:
pip install https://github.com/google-coral/pycoral/releases/download/v1.0.1/pycoral-1.0.1-cp37-cp37m-linux_armv7l.whl
- With your virtualenv activated, install tflite-runtime:
pip install https://github.com/google-coral/pycoral/releases/download/v1.0.1/tflite_runtime-2.5.0-cp37-cp37m-linux_armv7l.whl
- With your virtualenv activated, install pycoral:
- Carl should now be able to use Pycoral to interface with the Coral.