Giter Site home page Giter Site logo

w251_hw3's Introduction

w251_hw3

Project Summary

This project asked us to build a IoT application pipeline using a Jetson TX2 as the "edge" running through an MQTT broker-client pipeline to store captured images in the cloud.

In my MQTT pipeline I used QoS 0. I made this decision because it is the most minimal QoS level and part of the goal of this assignement was to remain lightweight. Since I had end-to-end control over the pipeline and there was no repurcussions if data was lost, QoS level 0 seemed appropriate since it will send a message once only and do nothing to guarantee receipt. I used a single MQTT topic and named it "faces" because it seemed like it fit with the theme of the assignment.

The faces can be located here: http://s3.us.cloud-object-storage.appdomain.cloud\alex-hw3-bucket

a sample image capture is shown below

face capture

Here is a screencap of the data being saved in the bucket

bucket

To make this all work

Starting on the jetson side...

Build the dockerfiles you want. I made a dockerfile for the face detection, the MQTT broker and the MQTT forwarder

cd /path/to/Dockerfile
docker build -t myimage .

Once the dockerfiles are built, create a network to tie the broker and forwarder

docker network create --driver bridge hw03

Start up your broker. In my dockerfile I already downloaded the mosquitto packages so I only need to start up the broker

docker run --name mosquitto --network hw03 -p 1883:1883 -ti broker sh
# in the container now, spin up mosquitto broker
/usr/sbin/mosquitto

Leave this running, open a new terminal and spin up the forwarder container. Once inside, I run the forwardMessage.py script

docker run --name forwarder --network hw03 -ti forwarder sh
# inside the container, run the script
python3 forwardMessage.py

Now the broker and forwarder are listening and ready to receive messages and sent them to the cloud. Moving over to the cloud...

In the cloud instance...

ssh to the cloud instance

ssh root@ip_of_vsi

build docker containers. I used the same broker container in the cloud as I did on the Jetson, I made a new one for the processor

cd /path/to/Dockerfile
docker build -t myimage .

build a docker network to tie the broker and processor together. Start up the broker, same way we did on the jetson

docker network create --driver bridge hw03
docker run --name mosquitto --network hw03 -p 1883:1883 -ti alpine sh
# now in the container run mosquitto
/usr/sbin/mosquitto

Leave this running, open a new terminal and spin up the processor container. Once inside, I run the saveToBucket.py script

docker run --name forwarder --network hw03 -ti processor sh
# now inside the container
python3 saveToBucket.py

Everything is now ready to extract faces. Back to the jetson

Back in the jetson...

open up a new terminal and spin up the face dectection container. NOTE: need to run xhost + to allow the container to see the webcam device

xhost +
docker run -e DISPLAY=$DISPLAY --net=host --privileged -ti faces

Pick up the camera and point it at your face. Go to bucket and see that face images have magically been stored there

w251_hw3's People

Watchers

 avatar

Forkers

favrecr mt467

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.