I recently built a Raspberry Pi demo featuring the Vision API showcased at a conference I spoke at in Ireland.. If you want a twist on the Dexter Industries’s Raspian for Robots Vision API demo, but without the whole Go-Pi-Go setup, this is a viable [easy] second option!
End product: you end up with an awesome handheld Raspberry Pi setup with a touch screen that calls the Vision API in real time to do label, logo, and facial detection. Save the photos you take in real time straight to the Raspberry Pi.
Why I built this demo: I used this demo to showcase how our trained APIs can run on even the smallest of edge devices that are low cost and perceived to have low compute with a small form factor to perform a variety of tasks as they relate to the Vision API. The Pi setups included a camera and screen to interface with the Pi, as well as a portable power source.
- Raspberry Pi 3 board
- Raspberry Pi V2 camera
- Raspberry Pi screen [that does NOT require additional custom kernels that might destroy your demo…] or the 7 “ Raspberry Pi touch screen
Option 1: The Lazy [normal] way: Flash the SD card (I used Etcher for Mac)
Access the image on Github here. Once complete, skip to Step 5 below.
Option 2: The Homo Logicus Struggle Way
- Flash Raspian for Robots on SD card [download here]
- When the SD card is flashed, power on the Pi. When the Pi is powered up, repartition the 2nd primary drive to ensure you do not run out of space. Follow directions here.
- Install Chromium. You will not be able to install the GCP SDK or log in to your admin console without Chromium. Directions here.
- Create or log in to your Google Cloud Platform account (don’t worry, you get 365 days of trial for free!)
- Download and install the Google Cloud platform SDK.
- Follow these steps to set up a service account API key. Store your key in a GCS bucket in the GCP project you plan on using for this demo.
- Navigate to the GCS bucket. Click on the .json file, then move it to /home/pi once it has downloaded.
- Follow steps on the tutorial here from the step titled “Set up the hardware.”
*Note: on the section “Make Credentials Permanent” when manipulating the bashrc profile, do not save it as the file path (“/home/pi/serviceaccountkey.json”). Just save it as the file itself:
*Another Note: If you receive an error referring to opentype, run this command to update your pyasn1 module:
sudo apt-get — reinstall install python-pyasn1 python-pyasn1-modules
This has happened occasionally when the winds were blowing the wrong way in our Google office (: