GithubHelp home page GithubHelp logo

allezsyh / denseflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-mmlab/denseflow

0.0 0.0 0.0 241 KB

Extracting optical flow and frames

Home Page: https://open-mmlab.github.io/

License: MIT License

CMake 5.69% C++ 85.63% Dockerfile 8.68%

denseflow's Introduction

Denseflow

Extracting dense flow field given a video.

Features

  • support multiple optical flow algorithms, including Nvidia hardware optical flow
  • support single video (or a frame folder) / a list of videos (or a list of frame folders) as input
  • support multiple output types (image, hdf5)
  • faster, 40% faster (by parallelize IO & computation)
  • record the progress when extract a list of videos, and resume by simply running the same command again (idempotent)

Install

Dependencies:

  • CUDA (driver version > 400)
  • OpenCV (with CUDA support): opencv3 | opencv4
  • Boost
  • HDF5 (Optional)
git clone https://github.com/open-mmlab/denseflow.git
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/app -DUSE_HDF5=no -DUSE_NVFLOW=no ..
make -j
make install

If you have trouble setting up building environments, scripts in INSTALL might be helpful.

Usage

Extract optical flow of a single video

denseflow test.avi -b=20 -a=tvl1 -s=1 -v
  • test.avi: input video
  • -b=20 bound set to 20
  • -a=tvl1 algorithm is tvl1
  • -s=1 step is 1, ie flow of adjacent frames
  • -v: verbose

Extract optical flow of a list of videos

denseflow videolist.txt -b=20 -a=tvl1 -s=1 -v
  • videolist.txt: a list of video paths
  • -b=20 bound set to 20
  • -a=tvl1 algorithm is tvl1
  • -s=1 step is 1, ie flow of adjacent frames
  • -v: verbose

Extract optical flow of a list of videos, each video is under a class folder

denseflow videolist.txt -b=20 -a=tvl1 -s=1 -cf -v
  • videolist.txt: a list of video paths
  • -b=20 bound set to 20
  • -a=tvl1 algorithm is tvl1
  • -s=1 step is 1, ie flow of adjacent frames
  • -cf this switch means that parent folder of the video is a class name
  • -v: verbose

Extract optical flow of a folder of frame images

denseflow test -b=20 -a=tvl1 -s=1 -if -v
  • test: folder of the frame images
  • -b=20 bound set to 20
  • -a=tvl1 algorithm is tvl1
  • -s=1 step is 1, ie flow of adjacent frames
  • -if indicates that inputs are frames
  • -v: verbose

Extract frames of a single video

denseflow test.avi -s=0 -v
  • test.avi: input video
  • -s=0 step 0 is reserved for extracting frames
  • -v: verbose

Extract frames of a list of videos

denseflow videolist.txt -s=0 -v
  • videolist.txt: a list of video paths
  • -s=1 step is 1, ie flow of adjacent frames
  • -s=0 step 0 is reserved for extracting frames
  • -v: verbose

Documentation

$ denseflow -h
GPU optical flow extraction.
Usage: denseflow [params] input

        -a, --algorithm (value:tvl1)
                optical flow algorithm (nv/tvl1/farn/brox)
        -b, --bound (value:32)
                maximum of optical flow
        --cf, --classFolder
                outputDir/class/video/flow.jpg
        -f, --force
                regardless of the marked .done file
        -h, --help (value:true)
                print help message
        --if, --inputFrames
                inputs are frames
        --newHeight, --nh (value:0)
                new height
        --newShort, --ns (value:0)
                short side length
        --newWidth, --nw (value:0)
                new width
        -o, --outputDir (value:.)
                root dir of output
        -s, --step (value:0)
                right - left (0 for img, non-0 for flow)
        --saveType, --st (value:jpg)
                save format type (png/h5/jpg)
        -v, --verbose
                verbose

        input
                filename of video or folder of frames or a list.txt of those

Citation

If you use this tool in your research, please cite this project.

@misc{denseflow,
  author =       {Wang, Shiguang* and Li, Zhizhong* and Zhao, Yue and Xiong, Yuanjun and Wang, Limin and Lin, Dahua},
  title =        {{denseflow}},
  howpublished = {\url{https://github.com/open-mmlab/denseflow}},
  year =         {2020}
}

Acknowledgement

Rewritten based on yuanjun's fork of dense_flow.

denseflow's People

Contributors

innerlee avatar yjxiong avatar wanglimin avatar xwen99 avatar zhaoyue-zephyrus avatar wangzheallen avatar sunnyxiaohu 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.