Skip to content

dzimine/aws-greengrass-ml-inference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Greengrass ML Inference Playground

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.

Pre-requisits

How to run

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.

  1. Install greengo. Use the head of master - I am moving this and greengo together.

    pip install git+git://github.com/dzimine/greengo.git#egg=greengo
    
  2. Create a Greengrass Core definition in AWS. See ./greengo.yaml for what will be created.

    greengo create
    
  3. 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
    
  4. Deploy Greengrass Core

    greengo deploy
    
  5. 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.

  6. The best part: once you've done playing, clean up your AWS resources:

    greengo remove
    

About

AWS Greengrass ML Inference Playground

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published