Giter Club home page Giter Club logo

bp-layers's Introduction

BP-Layers

This repository contains the implementation for our publication "Belief Propagation Reloaded: Learning BP-Layers for Labeling Problems". If you use this implementation please cite the following publication:

@InProceedings{Knobelreiter_2020_CVPR,
  author = {Knöbelreiter, Patrick and Sormann, Christian and Shekhovtsov, Alexander and Fraundorfer, Friedrich and Pock, Thomas},
  title = {Belief Propagation Reloaded: Learning BP-Layers for Labeling Problems},
  booktitle = {The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  month = {June},
  year = {2020}
} 

Repository Structure

The repository is structured as follows: - the base directory contains scripts for running inference and python implementations of the networks - 'data' includes sample images for stereo/semantic/flow inference - 'ops' contains custom PyTorch-Ops which need to be installed before running the respective stereo/semantic implementation (note that this is also taken care of by the run_*.sh scripts)

For your convenience, the required libraries are added as submodules. To clone them issue the command

git submodule update --init --recursive

Dependencies

  • Cuda 10.2
  • pytorch >= 1.3
  • argparse
  • imageio (with libpfm installed)*
  • numpy

The stereo results are saved as pfm images. If your imageio does not have libpfm installed automatically, execute the following command in a python:

imageio.plugins.freeimage.download()

In order to display pfm files we highly recommend the tool provided by the Middlebury stereo benchmark. You can find it here.

Running the implementation

After installing all of the required dependencies above you need to install the provided modules to you python environment. This can be done with

cd ops
python setup.py install

This will install the SAD matching kernels for stereo and Optical flow. The BP-Layer is installed automatically upon execution of the provided shell scripts. The following sections show how to use them.

Stereo

  • run_stereo_sf.sh: The models trained on the Scene-Flow Dataset
  • run_stereo_mb.sh: The model used for evaluation on the Middlebury dataset
  • run_stereo_kitti: The model used for evaluation on the Kitti dataset

Flow

  • run_flow.sh

Semantic Segmentation

  • run_semantic_global.sh: Our semantic segmentation model with global pairwise weights
  • run_semantic_pixel: Our semantic segmentation model with pixel-wise pairwise weights
sh run_semantic_pixel.sh

Should yield this result:

Inside these scripts you can also specify different images to be used for inference. The correct PyTorch-Ops are also automatically installed by these scripts before running the inference.

bp-layers's People

Contributors

pknoebelreiter avatar

Watchers

James Cloos 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.