This codifies AWS ML inference tutorial. The intend is a consistent repeatable development environment for experimenting and enjoying Greengrass ML Inference.
- Instead of using AWS Console, resource defined in with Greengo and created with Python/Boto3.
- Instead of Raspberry PI, a Ubuntu VM with Vagrant.
- Instead of a camera, images are dropped to an
/images
folder in a VM. The ML inference Lambda function uses access to local volume to read the images.
- A computer with Linux/MacOS, Python, git (dah!)
- Vagrant with VirtualBox
- AWS CLI installed and credentials configured. Consider using named profiles.
The instructions below is a rough draft that gives direction and can work with the right amount of extra hacking.
Read to the end before attempting to run. If it fails, don't get upset: this is work in progress and a trail, not a highway. Roll your sleeves, hack alone, PRs welcome.
-
Install
greengo
. Use the head ofmaster
- I am moving this andgreengo
together.pip install git+git://github.com/dzimine/greengo.git#egg=greengo
-
Create a Greengrass Core definition in AWS. See ./greengo.yaml for what will be created.
greengo create
-
Provision Greengrass Core VM. Vagrant will do the magic of installing Greengrass, placing certificates and configuration, and adding the necessary ML stuff on the GG Core VM.
vagrant up
-
Deploy Greengrass Core
greengo deploy
-
Profit!
Login to the Vagrant VM. Drop image files to
/images
. There are few already in./images
, and a script you can run in VM to randomly drop the files:vagrant ssh sudo su cd /vagrant/scripts ./feed.sh
Watch the GGC log files to see the results:
tail -f /greengrass/ggc/var/log/user/$AWS_REGION/$AWS_ACCOUNT/GreengrassImageClassification.log
I'll eventually get to posting them to MQTT - or you can take it as an exercise.
If you don't like the prediction, it has nothing to do with Greengrass - blame the pretrained squeezenet1_1 model offered in the AWS Tutorial, and bring a better one.
-
The best part: once you've done playing, clean up your AWS resources:
greengo remove