Git Product home page Git Product logo

opencv-kafka-demo's Introduction

Demo of Kafka and OpenCV

demo

Locally MacOS

brew install kafka librdkafka

Kafka + ZooKeeper are now running locally.

To start publishing your laptop camera to a kafka topic:

cd imagesfromopencv-to-kafka
CAMERA=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:

cd objectdetector
python3 app.py

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

cd imagewatcher
gunicorn __init__:app --reload -e CAMERA=kafka

View at http://localhost:8000

MacOS/tmux

brew install tmux
gem install tmuxinator

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

tmuxinator start demo

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

tmux kill-session -t demo

Cloud Foundry

To deploy all apps to Cloud Foundry:

bin/deploy.sh

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

2017-11-10T16:44:39.16+1000 [APP/PROC/WEB/0] ERR [2017-11-10 06:44:39 +0000] [6] [CRITICAL] WORKER TIMEOUT (pid:43)
2017-11-10T16:44:39.16+1000 [APP/PROC/WEB/0] ERR [2017-11-10 06:44:39 +0000] [43] [INFO] Worker exiting (pid: 43)
2017-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

opencv-kafka-demo's People

Contributors

drnic avatar starkandwayne-bot avatar

Watchers

 avatar

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.