Raspberry Pi (Legacy)
Deploy your Roboflow Train models to Raspberry Pi.
Prefer to learn using video? Check out our Raspberry Pi video guide.
Our Raspberry Pi deployment option runs directly on your devices in situations where you need to run your model without a reliable Internet connection.
Task Support
The following task types are supported by the hosted API:
Task Type | Supported by Hosted API |
---|---|
Object Detection | |
Classification | |
Instance Segmentation | |
Semantic Segmentation |
Deploy a Model to a Raspberry Pi
You will need a Raspberry Pi 4 (or Raspberry Pi 400) running the 64bit version of Ubuntu. To verify that you're running a compatible system, type arch
into your Raspberry Pi's command line and verify that it outputs aarch64
.
Then, open the terminal on the Raspberry Pi and install Docker using the convenience script:
Step 1: Install the Inference Server
The inference API is available as a Docker container optimized and configured for the Raspberry Pi. You can install and run the inference server using the following command:
You can now use your Pi as a drop-in replacement for the Hosted Inference API (see those docs for example code snippets in several programming languages).
Step 2: Install the Roboflow pip Package
Next, install the Roboflow python package with pip install roboflow
.
Step 3: Run Inference
To run inference on your model, run the following code, substituting your API key, workspace and project IDs, project version, and image name as relevant. You can learn how to find your API key in our API docs and how to find your workspace and project ID.
Here is an example result of our inference on a model:
You can also run as a client-server context and send images to the Pi for inference from another machine on your network. Replace localhost
in the local=
parameter with the Pi's local IP address.
Performance Expectations
We observed about 1.3 frames per second on the Raspberry Pi 400. These results were obtained while operating in a client-server context (so there is some minor network latency involved) and a 416x416 model.
If you need faster speeds you might want to try using the Luxonis OAK AI Cameras with your Raspberry Pi to accelerate your models.
See Also
Last updated