Coder Social home page Coder Social logo

crfrnn's Introduction

Tensorflow implementation of CrfRnn layer according to Conditional Random Fields as Recurrent Neural Networks.

This is a minor repackaging of this repo, which itself is based on the work of this repo.

Note this repo does not contain the kernel for the lattice dimensional filter. See Setup below.

Setup

  1. Clone this repository and add the parent directory to your PYTHONPATH
cd /path/to/parent_dir
git clone https://github.com/jackd/crfrnn
export PYTHONPATH=$PYTHONPATH:/path/to/parent_dir
  1. Get the source code for the kernel.
git clone --recursive https://github.com/MiguelMonteiro/CRFasRNNLayer
  1. change the number of channels to an appropriate value (to run the examples, this must be 21).
  2. build (you may need to manually install cmake). Note you'll need to change INPUT_CHANNELS to the number of classes.
  3. Copy lattice_filter.so to ./lattice_filter/lattice_filter.so

Manually Install CMake

Building the kernel requires CMake 3.9 or above. Ubuntu 16.04 ships with 3.5, so you may need to manually install the latest version. Following the instrucitons here:

sudo apt remove cmake
sudo apt purge cmake

version=3.11
build=2
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/

./bootstrap
make -j4
sudo make install

# Test
cmake --version

Keras Demo

To run the demo:

  1. Follow Setup instructions above.
  2. Download pretrained model weights here.
  3. Move weights to ./example/keras/crfrnn_keras_model.h5.
  4. Run the run_demo.py script.
cd /path/to/parent_dir/crfrnn/example/keras
mv ~/Downloads/crfrnn_keras_model.h5 ./crfrnn_keras_model.h5
./run_demo.py

Acknowledgement

As per the original repo, if you use this code/model for your research, please cite the following paper:

@inproceedings{crfasrnn_ICCV2015,
    author = {Shuai Zheng and Sadeep Jayasumana and Bernardino Romera-Paredes and Vibhav Vineet and
    Zhizhong Su and Dalong Du and Chang Huang and Philip H. S. Torr},
    title  = {Conditional Random Fields as Recurrent Neural Networks},
    booktitle = {International Conference on Computer Vision (ICCV)},
    year   = {2015}
}

crfrnn's People

Contributors

jackd avatar rl-navigation avatar

Watchers

 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.