Giter Site home page Giter Site logo

crfasrnn_pytorch's Introduction

CRF-RNN for Semantic Image Segmentation - PyTorch version

sample

Live demo:                           http://crfasrnn.torr.vision
Caffe version:                      http://github.com/torrvision/crfasrnn
Tensorflow/Keras version: http://github.com/sadeepj/crfasrnn_keras

This repository contains the official PyTorch implementation of the "CRF-RNN" semantic image segmentation method, published in the ICCV 2015 paper Conditional Random Fields as Recurrent Neural Networks. The online demo of this project won the Best Demo Prize at ICCV 2015. Results of this PyTorch code are identical to that of the Caffe and Tensorflow/Keras based versions above.

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}
}

Installation Guide

Note: If you are using a Python virtualenv, make sure it is activated before running each command in this guide.

Step 1: Clone the repository

$ git clone https://github.com/sadeepj/crfasrnn_pytorch.git

The root directory of the clone will be referred to as crfasrnn_pytorch hereafter.

Step 2: Install dependencies

Use the requirements.txt file in this repository to install all the dependencies via pip:

$ cd crfasrnn_pytorch
$ pip install -r requirements.txt

After installing the dependencies, run the following commands to make sure they are properly installed:

$ python
>>> import torch 

You should not see any errors while importing torch above.

Step 3: Build CRF-RNN custom op

Run setup.py inside the crfasrnn_pytorch/crfasrnn directory:

$ cd crfasrnn_pytorch/crfasrnn
$ python setup.py install 

Note that the python command in the console should refer to the Python interpreter associated with your PyTorch installation.

Step 4: Download the pre-trained model weights

Download the model weights from here and place it in the crfasrnn_pytorch directory with the file name crfasrnn_weights.pth.

Step 5: Run the demo

$ cd crfasrnn_pytorch
$ python run_demo.py

If all goes well, you will see the segmentation results in a file named "labels.png".

Contributors

crfasrnn_pytorch's People

Contributors

sadeepj 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.