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.1.tar.gz (4.2 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.1-py2-none-any.whl (4.5 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: videoflow-factory-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 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.1.tar.gz
Algorithm Hash digest
SHA256 5a44607dbcfea85cfcd86b7798f94f7050f62e7782e322a1724ac61f47acf53b
MD5 59fef436260ab009440a808537621cef
BLAKE2b-256 60b8dd3e0f1ed4ff8f283b475426ba315b8e77216377c03cc1d67a1510295cbe

See more details on using hashes here.

File details

Details for the file videoflow_factory-0.0.1-py2-none-any.whl.

File metadata

  • Download URL: videoflow_factory-0.0.1-py2-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2
  • 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.1-py2-none-any.whl
Algorithm Hash digest
SHA256 37c7b44736d51d9e20c7252f13cc48574e0f712d0d3e2fdeeeb2a28c63780b59
MD5 ef7469a7c86a41da9975e8867d6bbf04
BLAKE2b-256 8019ac22fa4cf8394b1a0a5a2699c8d59e75865181590b76580adaae1987d2d7

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