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.3.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.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: videoflow-factory-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 0ded5ff08bdb6aa57e2f3a23333c8b7d05ad7191a4a05cb9734b58abe2668e63
MD5 df8382b4bf83a7e30622352e2c5dbbaf
BLAKE2b-256 31bae8aae64f29b004d70b9a8cc375246a523a34e07afb8969b2ad456edd284f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: videoflow_factory-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8e599add6fbb309205e0d61d6896bd9e603234745a808ae4c3c267e03667c2
MD5 3505b6e9f490ca22f21d2c620935bee1
BLAKE2b-256 21e285473bf5cb2f1aa471ee8f1dd1232644e0f8d1447794722e994736f7d421

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