Package: videoflow
VideoflowVideoflowis a Python framework for video stream processing. The library is designed to facilitate easy and quick definition of computer vision stream processing pipelines. It empowers developers to build applications and systems with self-contained Deep Learning and Computer Vision capabilities using simple and few lines of code.  It contains off-the-shelf reference components for object detection, object tracking, human pose estimation, etc, and it is easy to extend with your own.The complete documentation to the project is located indocs.videoflow.devInstalling the frameworkRequirementsBefore installing, be sure that you havecv2already installed. Python 2 isNOT SUPPORTED.  Requires Python 3.6+.  There are someknown issuesto run it on Windows tooInstallationYou can install directly usingpipby doingpip3 install videoflowAlternatively, you can install by:Clone this repositoryInside the repository folder, executepip3 install . --userUsage with docker# clone repodockerbuild-trepo/videoflow:latest.# runs examples/object_detector.py by defaultdockerrun-u$(id-u):$(id-g)-v$(pwd):/usr/src/apprepo/videoflow# or mount the volume from your code directory  to /usr/src/appdockerrun-u$(id-u):$(id-g)-v$(pwd):/usr/src/apprepo/videoflowpython/usr/src/app/yourown.pyContributing:A tentativeroadmapof where we are headed.Contribution rules.If you have new processors, producers or consumers that you can to create, check thevideoflow-contribproject.  We want
to keep videoflow succinct, clean, and simple, with as minimal dependencies to third-party libraries as necessaries.videoflow-contribis better suited for adding new components that require new library
dependencies.Sample Videoflow application:Below a sample videoflow application that detects automobiles in an intersection. For more examples see theexamplesfolder. It uses detection model published bytensorflow/modelsimportvideoflowimportvideoflow.core.flowasflowfromvideoflow.core.constantsimportBATCHfromvideoflow.consumersimportVideofileWriterfromvideoflow.producersimportVideofileReaderfromvideoflow_contrib.detector_tfimportTensorflowObjectDetectorfromvideoflow.processors.vision.annotatorsimportBoundingBoxAnnotatorfromvideoflow.utils.downloaderimportget_fileURL_VIDEO="https://github.com/videoflow/videoflow/releases/download/examples/intersection.mp4"classFrameIndexSplitter(videoflow.core.node.ProcessorNode):def__init__(self):super(FrameIndexSplitter,self).__init__()defprocess(self,data):index,frame=datareturnframeinput_file=get_file("intersection.mp4",URL_VIDEO)output_file="output.avi"reader=VideofileReader(input_file)frame=FrameIndexSplitter()(reader)detector=TensorflowObjectDetector()(frame)annotator=BoundingBoxAnnotator()(frame,detector)writer=VideofileWriter(output_file,fps=30)(annotator)fl=flow.Flow([reader],[writer],flow_type=BATCH)fl.run()fl.join()The output of the application is an annotated video:The Structure of a flow applicationA flow application usually consists of three parts:In the first part of the application you define a directed acyclic graph of computation nodes. There are 3 different kinds of nodes: producers, processors and consumers.  Producer nodes create data (commonly they will get the data from a source that is external to the flow).  Processors receive data as input and produce data as output. Consumers read data and do not produce any output.  You usually use a consumer when you want to write results to a log file, or when you want to push results to an external source (rest API, S3 bucket, etc.)To create a flow object, you need to pass to it your list of producers and your list of consumers. Once a flow is defined you can start it.  Starting the flow means that the producers start putting data into the flow and processors and consumers start receiving data.  Starting the flow also means allocating resources for producers, processors and consumers.  For simplicity for now we can say that each producer, processor and consumer will run on its own process space.Once the flow starts, you can also stop it.  When you stop the flow, it will happen organically.  Producers will stop producing data.  The rest of the nodes in the flow will continue running until the pipes run dry.  The resources used in the flow are deallocated progressively, as each node stops producing/processing/consuming data.Citing VideoflowIf you use Videoflow in your research please use the following BibTeX entry.@misc{deArmas2019videoflow,
  author =       {Jadiel de Armas},
  title =        {Videoflow},
  howpublished = {\url{https://github.com/videoflow/videoflow}},
  year =         {2019}
}