BrickPi Candy Sorter
Sort your Halloween candy with Google Cloud Vision and Raspberry Pi.
6. Prepare the Raspberry Pi
Since we’re using Raspbian for Robots, there are only a few changes that need to be made to the software. All of them are specific to using Google Cloud Vision on the Raspberry Pi. We have a very thorough tutorial on how to get set up here. In short you’ll need to run the following in the command line:
sudo pip install --upgrade pip
sudo apt-get install libjpeg8-dev
sudo pip install --upgrade google-api-python-client
sudo pip install --upgrade Pillow
sudo apt-get install python-picamera, espeak
Finally, you’ll need to upload your Google Application Credentials in JSON to the Raspberry Pi. Use an FTP program (such as FileZilla) or for Windows users Samba (
Next, we’ll turn on Super User and make our credentials available. In the command line, type the command “su”:
sudo
You may need to run:
sudo su
and you may need to enter in your password.
Next, we’ll make the JSON credentials available to Python. In the command line, run the following:
export GOOGLE_APPLICATION_CREDENTIALS=filename.json
Be sure to substitute your JSON filename in this command with the name of the file you have on your Raspberry Pi.
Finally, we’ll download the code. Again, this should go into the home directory: