Home

Awesome

Denseflow

Extracting dense flow field given a video.

Features

Install

Dependencies:

git clone https://github.com/open-mmlab/denseflow.git
cd denseflow && 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

Extract optical flow of a list of videos

denseflow videolist.txt -b=20 -a=tvl1 -s=1 -v

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

Extract optical flow of a folder of frame images

denseflow test -b=20 -a=tvl1 -s=1 -if -v

Extract frames of a single video

denseflow test.avi -s=0 -v

Extract frames of a list of videos

denseflow videolist.txt -s=0 -v

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.