Skip to main content

No project description provided

Project description

EPypes

EPypes (for event-driven piplines) is a Python library for developing data processing algorithms in a form of computational graphs and their integration with distributed systems based on publish-subscribe communication. The initial use case of EPypes is computer vision alogorithms development, although it is suitable for any algorithm that can be expressed as a directed acyclic graph.

EPypes facilitates flexibility of algorithm prototyping, as well as provides a structured approach to managing algorithm logic and exposing the developed pipelines as a part of on-line publish-subscribe systems. Currently, ZeroMQ middleware is supported, with data serialization based on Protocol Buffers.

Modules

The most important modules include:

  • compgraph, graph -- primitives for construction and execution of computational graphs
  • pipeline, node -- primitives for extendind computational graphs with additional functionality, specifically the reactive behavior
  • zeromq -- adapters to ZeroMQ middleware
  • reactivevision -- functionality for creation of reactive computer vision components

Installation and requirements

The core dependencies for the EPypes codebase include pyzmq, protobuf, and networkx>=2.0. They are listed in the requirements.txt file, and can be installed in one of the following ways:

# using pip
$ pip install -r requirements.txt

# using conda
$ while read requirement; do conda install --yes $requirement -c conda-forge; done < requirements.txt

Usage examples

The example below demostrates construction and execution of a computational graph. The demonstrated algorithm accepts a BGR image, converts it to grayscale, blurs the grayscale, and feeds the blurred image to the Canny edge detector.

import cv2
from epypes.compgraph import CompGraph
from epypes.compgraph import CompGraphRunner

def grayscale(im):
    return cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)

def gaussian_blur(im, kernel_size):
    return cv2.GaussianBlur(im, (kernel_size, kernel_size), 0)

if __name__ == '__main__':

    func_dict = {
        'grayscale': grayscale,
        'canny': cv2.Canny,
        'blur': gaussian_blur
    }

    func_io = {
        'grayscale': ('image', 'image_gray'),
        'blur': (('image_gray', 'blur_kernel'), 'image_blurred'),
        'canny': (('image_blurred', 'canny_lo', 'canny_hi'), 'edges'),
    }

    hparams = {
        'blur_kernel': 11,
        'canny_lo': 70,
        'canny_hi': 200
    }

    cg = CompGraph(func_dict, func_io)
    runner = CompGraphRunner(cg, hparams)

    im = cv2.imread('my_image.jpg', cv2.IMREAD_COLOR)
    runner.run(image=im)

For more complex computational graphs examples, refer to the following Jupyter notebooks:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epypes-0.1.1.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epypes-0.1.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file epypes-0.1.1.tar.gz.

File metadata

  • Download URL: epypes-0.1.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for epypes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 463b5a9a4b149656cc813d512f59ff944b76878e2eff5d1f20ec76896fc43927
MD5 550c2886a37fe19df7139c166053dea2
BLAKE2b-256 998dbf9d72d8f5e124dc3584f11aa5929b0742cef07d7020528047cee5556162

See more details on using hashes here.

File details

Details for the file epypes-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: epypes-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for epypes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9834ef3823ba41a150cf296020b9828508c57468ebe26ab423b9051d015f96b8
MD5 cd47e5fc6800cf5bf7fb12ac42b4ca83
BLAKE2b-256 924c92389ca7529d1c40d0148d6a80f38954d7172a56672bf930e2dca8280969

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page