starkandwayne/opencv-kafka-demo

Name: opencv-kafka-demo

Owner: Stark & Wayne

Description: null

Created: 2017-11-07 03:58:01.0

Updated: 2017-12-05 00:33:23.0

Pushed: 2017-12-08 02:28:34.0

Homepage: null

Size: 2500

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Demo of Kafka and OpenCV

demo

Locally MacOS
 install kafka librdkafka

Kafka + ZooKeeper are now running locally.

To start publishing your laptop camera to a kafka topic:

magesfromopencv-to-kafka
RA=opencv python3 app.py

To start processing the images from Kafka topic via OpenCV to do object detection, and push the resulting images onto a new Kafka topic:

bjectdetector
on3 app.py

To run a webserver that streams the resulting images to a web page:

magewatcher
corn __init__:app --reload -e CAMERA=kafka

View at http://localhost:8000

MacOS/tmux
 install tmux
install tmuxinator

There is a local .tmuxinator.yml that will now start zookeeper/kafka, and then run all the different processes:

inator start demo

To exit the tmux session, use tmux command ctrl-c d. Then to kill the session and its processes:

 kill-session -t demo
Cloud Foundry

To deploy all apps to Cloud Foundry:

deploy.sh

If an application fails to run and has the following in its logs, then perhaps Kafka cluster is unhealthy:

-11-10T16:44:39.16+1000 [APP/PROC/WEB/0] ERR [2017-11-10 06:44:39 +0000] [6] [CRITICAL] WORKER TIMEOUT (pid:43)
-11-10T16:44:39.16+1000 [APP/PROC/WEB/0] ERR [2017-11-10 06:44:39 +0000] [43] [INFO] Worker exiting (pid: 43)
-11-10T16:44:39.19+1000 [APP/PROC/WEB/0] ERR [2017-11-10 06:44:39 +0000] [141] [INFO] Booting worker with pid: 141

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.