Skip to main content

videoflow_factory

Project description

videoflow-factory

videoflow-factory is a library for dynamically generating Videoflow DAGs from YAML configuration files.

Installation

To install videoflow-factory run pip install videoflow-factory. It requires Python 3.6.0+ and Videoflow.

Usage

After installing videoflow-factory in your environment, there are two steps to creating DAGs. First, we need to create a YAML configuration file. For example:

od_flow:
  description: "Fynd Trak: MD & OD to Cache Flow"
  owner: "Kaushik B"
  tasks:
    reader:
      operator: videoflow.producers.VideoFileReader
      node: Producer
      arguments:
        video_file: "./videos/sample.mp4"
    frame:
      operator: videoflow.processors.basic.FrameIndexSplitter
      node: Processor
      dependencies: [reader]
    od_key:
      operator: videoflow.processors.KeyGenerator
      node: Processor
      arguments:
        store_id: "abc"
        video_id: "abc"
        prefix: "od"
      dependencies: [reader]
    motion_detector:
      operator: videoflow.processors.detector.motion_detector.OpencvMotionDetector
      node: Processor
      dependencies: [frame]
    object_detector:
      operator: videoflow.processors.detector.AsyncObjectDetector
      node: Processor
      arguments:
        url: "https://sample.url.com/api/v1/predict"
        nb_concurrent_tasks: 500
        gradual_increase_task: True
      dependencies: [frame]
    od_md_result_generator:
      operator: videoflow.processors.OdMdResultGenerator
      node: Processor
      dependencies: [motion_detector, object_detector]
    redis_cache:
      operator: videoflow.cache.RedisCache
      node: Consumer
      dependencies: [od_key, od_md_result_generator]

Then create a python script like this:

from videoflow_factory import VideoflowFactory
import os

od_flow_config = os.path.abspath("./od_flow.yaml")

od_flow = VideoflowFactory(od_flow_config)()

od_flow.run()
od_flow.join()

And this DAG will be generated and the Flow will start running!

Benefits

  • Construct DAGs without knowing Python
  • Construct DAGs without learning VideoFlow primitives
  • Avoid duplicative code
  • Everyone loves YAML! ;)

Contributing

Contributions are welcome! Just submit a Pull Request or Github Issue.

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

videoflow-factory-0.0.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

videoflow_factory-0.0.4-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file videoflow-factory-0.0.4.tar.gz.

File metadata

  • Download URL: videoflow-factory-0.0.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.5

File hashes

Hashes for videoflow-factory-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6677f8bf136fc8445075ba9ff47830476e296871dc107edf7eceb1c79cc9d257
MD5 09f794ddcee24a952209104bb361aea4
BLAKE2b-256 81986da913d57e00e08016e6e25ed1e881c489e671860ca51a0ddea205f760b0

See more details on using hashes here.

File details

Details for the file videoflow_factory-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: videoflow_factory-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.5

File hashes

Hashes for videoflow_factory-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 90cbe8da05247ea09b55e968874f3a2a28e1b2e0f955a2af251b655dac7d78e0
MD5 3bbc69e11dd40071738c76aa5338281f
BLAKE2b-256 0ed1f8bb4b00b671d8cdae65e10521d3442fbb967daa497b6af2b0d07b6e8b56

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