dragosh / pico

Object Detection and Analysis Made easy using Raspberry Pi, Apache Kafka, AWS Rekognition & Docker

Home Page:http://www.collabnix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Pico Project

Object Detection & Text Analytics Made Simple using Docker, Apache Kafka, IoT & Amazon Rekognition System

alt text

What is Pico all about?

Imagine you are able to capture live video streams, identify objects using deep learning, and then trigger actions or notifications based on the identified objects - all using Docker containers. With Pico, you will be able to setup and run a live video capture, analysis, and alerting solution prototype.

alt text

A camera surveils a particular area, streaming video over the network to a video capture client. The client samples video frames and sends them over to AWS, where they are analyzed and stored along with metadata. If certain objects are detected in the analyzed video frames, SMS alerts are sent out. Once a person receives an SMS alert, they will likely want to know what caused it. For that, sampled video frames can be monitored with low latency using a web-based user interface.

The Pico framework uses Kafka cluster to acquire data in real-time. Kafka is a message-based distributed publish-subscribe system, which has the advantages of high throughput and perfect fault-tolerant mechanism. The type of data source is the video that generated by the cameras attached to Raspberry Pi.

alt text

Offerings

  • Pico for AWS
  • Pico for On-Premises(Using Swarm & Kubernetes)

Preparing Your Environment

Items Link Reference
Raspberry Pi 3 Model B Buy Buy
Raspberry Pi Infrared IR Night Vision Surveillance Camera Module 500W Webcam Buy Buy
5MP Raspberry Pi 3 Camera Module W/ HBV FFC Cable Buy Buy

View of Raspberry Pi Stack

alt text

Getting Started

Running Producer inside Docker Container

sudo docker run -it --privileged --device /dev/video0:/dev/video0 ajeetraina/pico-producer-rpi python3 producer_camera.py

Verify that it is running fine

CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS               NAMES
81891d992daf        ajeetraina/pico-producer-rpi   "/usr/bin/entry.sh p…"   9 minutes ago       Up 9 minutes                            jolly_dewdney

Setting up Kafka Cluster on Cloud Platform

Running Kafka on Swarm Cluster on AWS

In order to run Kafka on AWS, you need t2.medium instances which doesn't fall under Free Tier. You will need to use your FREE credits or pay for its usage. Alternatively, for development purpose if you are not concerned about performance, you can use GCP instances.

I assume that you have Docker and Docker Compose installed on multiple Swarm Mode Cluster

Cloning the Repository

git clone https://github.com/collabnix/pico
cd pico/kafka
docker stack deploy -c docker-compose.yml mykafka

That's it. Your AWS KAfka cluster is up and running on Docker Swarm Nodes.

Running the Consumer Script

To run the consumer script, we need to focus on two files:

  • consumer.py and
  • image_processor.py

Under the image_processor.py you need to add ACCESS KEY details of your AWS account and under consumer.py you need to add your correct kafka cluster IP.

Here you go..

Just place any object in front of camera module and it shall detect the object automatically with tagging about the object type.

Governance

This project was incubated by Ajeet Singh Raina Docker Captain & Docker Community Leader & Avinash Bendigeri(Data Science Engineer)

Getting Started - The Hard Way

Stage I - Installing Docker on Raspberry Pi
Stage II - Turn Your Raspberry Pi into Night survillience Camera using Docker
Stage III - Deploy Apache Kafka on AWS Platform using Docker Swarm
Stage IV - Pushing the video frame from Raspberry Pi to Apache Kafka
Stage IV - - Preparing AWS Lambda Deployment Package in Python & Testing Kafka Connect AWS Lambda Connector

About

Object Detection and Analysis Made easy using Raspberry Pi, Apache Kafka, AWS Rekognition & Docker

http://www.collabnix.com


Languages

Language:Jupyter Notebook 54.3%Language:Python 23.2%Language:Java 20.2%Language:Dockerfile 1.0%Language:HTML 1.0%Language:Shell 0.4%