GithubHelp home page GithubHelp logo

filippoaleotti / cpm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yinlinhu/cpm

0.0 1.0 1.0 42.61 MB

Docker wrapper to CPM and RIC flow

License: GNU General Public License v3.0

CMake 0.12% C++ 99.38% Shell 0.30% Dockerfile 0.10% Makefile 0.09%

cpm's Introduction

Docker wrapper to CPM-flow and RIC-flow

This project wraps two methods for optical flow estimation and refinement. In particular, methods are:

  • Efficient Coarse-to-Fine PatchMatch for Large Displacement Optical Flow: original code available here
  • Robust Interpolation of Correspondences for Large Displacement Optical Flow: original code available here

Since both the code-bases require opencv-3.x and opencv-contribs for C++, this project enables to deploy them on different machines using a shared Docker container.

Run

The base image already contains opencv-3.4.11 and opencv-contribs compiled for C/C++.

You can build the container by running:

sudo docker build --tag flow_container $PWD

The image contains a workspace folder with CPM and RIC folders inside.

From this image, you can start a new container from it with:

sudo docker run -it --name demo flow_container 

Then, you are free to call a single project or to combine them. For instance, to run CPM's demo, you can:

bash demo.sh

Data folder binding

You can also bind local folders in your machine with folders inside the container. For instance, you can bind the data-demo folder (copied inside the conainer) with our local data-demo folder. Be aware that removing files from your local folder will do the same inside the container's linked folder.

sudo docker run -it -v ${PWD}/data-demo:/workspace/data-demo --name flow flow_container

By running the demo.sh script you can notice that your local data-demo folder now contains the results of CPM and RIC.

NOTE: If $DATA is a remote disk, it has to be mounted using sudo sshfs

Process a dataset

The script process_dataset.sh allows to run CPM+RIC for a list of images.

DATA=path_to_dataset_folder
OUTDIR="output"
NAMES=path_to_file_with_names.txt

mkdir $OUTDIR
sudo docker run -it -v $DATA:/workspace/dataset -v $OUTDIR:/workspace/temp -v $NAMES:/workspace/names.txt --name flow flow_container

Note that $DATA and $OUTDIR have to be absolute paths.

Then:

bash process_dataset.sh /workspace/dataset /workspace/temp /workspace/names.txt

Where $NAMES is a txt file where each line looks like:

path_to_image1 path_to_image2 final_name

The path to the image (e.g., image1) is given by $DATA/path_to_image1

Stop containers and Delete images

To stop every running container, you can run:

sudo docker stop $(sudo docker ps -a -q); sudo docker rm $(sudo docker ps -a -q)

Moreover, if you desire to free disk space, you can delete the Docker image. To delete every docker image, run:

sudo docker image prune -a

NOTE: Do not run these commands if you are using Docker in other projects

Citations

@inproceedings{hu2016cpm,
  title={Efficient Coarse-to-Fine PatchMatch for Large Displacement Optical Flow},
  author={Yinlin Hu and Rui Song and Yunsong Li},
  booktitle={CVPR},
  year={2016}
}
@inproceedings{hu2017robust,
  title={Robust interpolation of correspondences for large displacement optical flow},
  author={Hu, Yinlin and Li, Yunsong and Song, Rui},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={481--489},
  year={2017}
}

cpm's People

Contributors

yinlinhu avatar filippoaleotti avatar csukuangfj avatar abrock avatar noesh avatar

Watchers

James Cloos avatar

Forkers

noesh

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.