Home

Awesome

GPU based optical flow extraction from videos

Forked from https://github.com/feichtenhofer/gpu_flow by Antonino Furnari

Build Status Docker Hub Singularity Hub

News

2020-01-09

The semantics of the dilation parameter have changed to allow finer grained configuration. Previously optical flow was computed between frames I_{st} and I_{s(t+d)} where s is the stride and d the dilation. The code now computes flow between I_{st} and I_{st+d}--this makes the stride and dilation parameters completely independent which is more intuitive. If you wish to continue using the old code then use the docker image tagged with v1. All subsequent images and the latest tag will adopt the new behaviour described above.

Usage

We support running via docker and singularity.

Docker

Details

The software assumes that all video frames have been extracted in a directory. Files should be named according to some pattern, e.g., img_%07d.jpg. The software will put flow files in the same directory using a provided filename pattern, e.g., flow_%s_%07d.jpg, where the %s will be subsituted with "x" for the x flows and "y" for the y flows. For example, if DIR is a directory containing 4 images:

DIR:

the command compute_flow DIR img_%07d.jpg flow_%s_%07d.jpg will read the images in order and compute optical flows. The content of DIR will be as follows after the execution of the command:

DIR:

where flow_x_{n}.jpg is the x flow computed between img_{n}.jpg and img_{n+1}.jpg (if no dilation is used - see help).

Build

You only need to build this software if you intend on tweaking the source, otherwise you should just use the pre-built docker images.

Dependencies:

Installation

First, build opencv with gpu support. To do so, download opencv 2.4.x sources from https://opencv.org/releases.html. Unzip the downloaded archive, then enter the opencv folder and issue the following commands:

Then clone the current repository and enter the compute_flow_video folder. Type: