Giter VIP home page Giter VIP logo

accel-video-pipe's Introduction

Accel-Video Pipe

Accel-Video Pipe (AV-Pipe or AVP) is an integrated C++ library for AI video inference tasks on customers' devices, aiming to provide easily-used and high-performance experience for users.

Note: as the main work of my independent undergrad thesis, this project is still under development. Feel free to play with AV-Pipe and post any question or suggestion👏.

Key Features

AVP Framework:

  • Modeling the AI video inference task as a continuously running DAG graph, each DAG node can be treated as a modularized component with certain generalizability.

  • Rich support for neural network inference, including:

    • LibTorch (Caffe2)
    • OpenVINO (Intel® CPU, GPU, VPU)
    • ONNXRuntime
    • TensorRT (Nvidia® GPU)
    • TVM (not well supported now)
    • ncnn (For mobile device, still testing...)

    Note: mainly focus on ONNX network format. For TensorFlow-Models, plz check the mediapipe.

  • Multi-platform: (Consider iOS/Android in the future...)

  • Simple coding style. You can build a video inference pipeline with less than 50 lines of C++.

AVP Automation:

  • Automatically code generation by using YAML pipeline configurations. User just need to write YAML files to configure the pipe components (PipeProcessor in AVP) and connect different PipeProcessors. avp_automation.py class will handle the YAML files and automatically generate the target C++ code and cmake it.

    Note: a nice front-end UI will bring even better user experience.

  • Automatically pipeline optimization. avp_automation.py also has profile method and multi-threading method to first estimate the timing info of each PipeProcessor and then do an automatic thread allocation and scheduling.

  • Visualization of AVP pipeline. avp_automation provides visualize method to show the DAG graph of pipeline possibly with timing info and thread info.

    E.g. AVP pipeline of pose_estimation, different colors represent different threads.

The Structure of Accel-Video-Pipe

Namespace: avp

Base Classes (in avpipe/base.hpp):

  • StreamPacket: to store temporal data to be processed;

    • mat: cv::Mat type, used for opencv-related operations/computations;
    • tensor: aT::Tensor type (maybe the most friendly C++ tensor type), used for DNN-related operations.
  • Stream: a queue of StreamPacket with thread-safe, synchronized blocking mechanisms.

  • PipeProcessor: the actual computing module;

    • init: for initialization
    • process: a universal procedure for each computing module:
      • take StreamPacket from inStreams, prepare the StreamPacket for outStreams.
    • run: a virtual function must be implemented by different modules.
    • bindStream: used to bind Stream to the PipeProcessor.

Setup and Play

Environment

you need to install the following C++ libraries to use the AV-Pipe.

Optional: (depending on your use case)

Play the demo

Run the python script:

# run "python avp_automation/run.py -h" to see how to use
python avp_automation/run.py -f avp_example/pose_estimation.yaml -l POVGBR --loop_len 50

Explain: in -l option, POVGBR defines a sequence of actions which are [Profile, Optimize, Visualize, Gen-code, Build, Run].

Development Info

Please see Dev Roadmap.

accel-video-pipe's People

Contributors

nexuslrf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.