Skip to content

Latest commit

 

History

History
 
 

part-4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Part 4 - Setting up your Amazon Web Service (AWS) Cloud Service

Set up streaming of data from Dragonboard to AWS S3 bucket. Following are the steps necessary to stream detected faces to AWS.

If you would like to read more about this project, please visit this blog written by Manivannan Sadhasivam.

Table of Contents


1) Hardware

1.1 Hardware requirements

1.2 Hardware setup

  • DragonBoard 410 is powered off
  • Connect USB webcam
  • Connect I/O devices (Monitor, Keyboard, etc...)
  • Power on your DragonBoard 410c with 96Boards compliant power supply

2) Software

2.1 Operating System

2.2 Package Dependencies

Install the package dependencies mentioned in Part-2 along with the following:

$ sudo easy_install boto3
$ sudo apt-get install awscli

2.3 Setup AWS account

Follow the instructions mentioned here for creating AWS account.

2.4 Create S3 bucket

  • Go to https://aws.amazon.com/ and select Sign in to console
  • Login to AWS using your Email and password (You’ll be redirected to console if you are already logged in)
  • Select S3 from Storage. S3 console will get opened.
  • Click on Create bucket button
  • Enter Bucket name and Region in the opened window (Bucket name should be unique across all existing bucket names in S3).
  • Click Next
  • If you want to customize your bucket, modify the properties otherwise keep on hitting Next until you find Create bucket button.
  • In the final window, you should see the Bucket name, region, properties and permissions. Under permissions the instance of the login account should get displayed. Then, click Create bucket.
  • The created bucket would get listed in the AWS S3 console.

2.5 Set Object policy

  • Select the created bucket and click Permissions tab on top
  • Select Bucket policy and paste the following policy in the text field
{
  "Id": "Policy1495783674300",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1495783672125",
      "Action": "s3:*",
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::homesurveillance",
      "Principal": "*"
    }
  ]
}
  • Replace ‘homesurveillance’ with your bucket name in the above policy and click Save.
  • The above shown policy is just for demonstration purpose as it allows all AWS users to gain full access to the created bucket.

2.6 Setup Boto SDK

  • Obtain the AWS key Id and secret key by following the instructions here

  • Execute the below command to configure boto SDK with created AWS Id and key

$ sudo aws configure
  • Enter AWS access Id and press Enter
  • Enter Secret key and press Enter
  • Enter region name and press Enter
  • You can leave the default output format as [None]. Just press Enter
  • Now Boto SDK has been configured. The entered credentials could be found in ~/.aws/credentials

3) Project Execution

Clone the project repository

$ git clone https://github.com/96boards/projects.git
$ cd projects/home-surveillance/part-4

Place the trained dataset and haarcascade_frontalface_default.xml created in Part-2 to current directory. Also, update the USB webcam video source as specified in Part-2

$ cp -r ../part-2/trainer ../part-2/haarcascade_frontalface_default.xml ./
$ mkdir captured
$ sudo python streamface.py

Script will stream the first instance of detected faces onto AWS S3 bucket. Go to AWS S3 bucket to see the list of streamed faces.

Link to Blog