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.2.tar.gz (4.9 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.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: videoflow-factory-0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 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.2.tar.gz
Algorithm Hash digest
SHA256 7720256e8941547fd4cdcf51af069e044a5e69701a50390c5b0c8f0711daecb0
MD5 843e2d48289eda961f11ddc7f9249c71
BLAKE2b-256 d3d2c359fc87c1fc921ff56d5e72a2c6bd263db42cba095736ee8259dc27c703

See more details on using hashes here.

File details

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

File metadata

  • Download URL: videoflow_factory-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0be061706587d5f6600bbbc9911ccb3c6059ce8618eaa33071c80669694f98b5
MD5 b810dc658cac3cdcfe5db383c8e78e5d
BLAKE2b-256 eb13a7ed5938c6895d3bbdbb1b6b8a0c241985776f90b9d950e0d3040fc3b8b2

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