Skip to content

hmahadik/zmq_pub_sub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python ZMQ pub/sub pattern sample

Installation

Optional: Install the necessary packages if not already installed.

# may need to be executed as root (sudo)
apt-get install git
apt-get install python3 python3-setuptools
easy_install3 pip
pip3 install virtualenv

Required steps:

# clone git repo
git clone https://github.com/hmahadik/zmq_pub_sub.git
cd zmq_pub_sub

# set up virtualenv
python3 -m virtualenv .zmqvenv
source .zmqvenv/bin/activate

# install dependencies
pip3 install -r requirements.txt

Run Publisher

Starts streaming frames from your local webcam (device 0) to tcp port 5556 on two topics: inference and postprocess.

python3 stream_pub.py

Run Subscribers

Inference topic subscriber receives and displays frames that have been resized to 300x300.

python3 stream_sub.py inference

Postprocess topic subscriber receives and displays a video stream where each frame is 1280x720.

python3 stream_sub.py postprocess

To-do

  • inference subscriber performs inference on frames
  • inference subscriber publishes a metadata stream (bounding boxes, classes, confidences)
  • postprocess subscriber subscribes to the metadata stream published by inference subscriber
  • postprocess subscriber overlays the metadata on the 1280x720 video stream before displaying it

About

zmq pub/sub pattern python sample

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages