Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sadeepj authored Nov 29, 2019
1 parent c84565b commit 8838100
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<b>Caffe version:</b> [http://github.com/torrvision/crfasrnn](http://github.com/torrvision/crfasrnn)<br/>
<b>Tensorflow/Keras version:</b> [http://github.com/sadeepj/crfasrnn_keras](http://github.com/sadeepj/crfasrnn_keras)<br/>

This repository contains PyTorch code for the "CRF-RNN" semantic image segmentation method, published in the ICCV 2015 paper [Conditional Random Fields as Recurrent Neural Networks](http://www.robots.ox.ac.uk/~szheng/papers/CRFasRNN.pdf). This paper was initially described in an [arXiv tech report](http://arxiv.org/abs/1502.03240). The [online demo](http://crfasrnn.torr.vision) of this project won the Best Demo Prize at ICCV 2015. Original Caffe-based code of this project can be found [here](https://github.com/torrvision/crfasrnn). Results produced with this PyTorch code are almost identical to that with the Caffe-based version.
This repository contains the PyTorch implementation of the "CRF-RNN" semantic image segmentation method, published in the ICCV 2015 paper [Conditional Random Fields as Recurrent Neural Networks](http://www.robots.ox.ac.uk/~szheng/papers/CRFasRNN.pdf). This research was initially described in an [arXiv tech report](http://arxiv.org/abs/1502.03240). The [online demo](http://crfasrnn.torr.vision) of this project won the Best Demo Prize at ICCV 2015. Original Caffe-based code of this project can be found [here](https://github.com/torrvision/crfasrnn). Results produced with this PyTorch code are almost identical to that with the Caffe-based version.

If you use this code/model for your research, please cite the following paper:
```
Expand All @@ -30,7 +30,7 @@ The root directory of the clone will be referred to as `crfasrnn_pytorch` hereaf

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

Use the `requirements.txt` file (or `requirements_gpu.txt`, if you have a GPU device) in this repository to install all the dependencies via `pip`:
Use the `requirements.txt` file in this repository to install all the dependencies via `pip`:
```
$ cd crfasrnn_pytorch
$ pip install -r requirements.txt
Expand All @@ -43,16 +43,15 @@ $ python
```
You should not see any errors while importing `torch` above.

### Step 3: Build CRF-RNN custom op C++ code
### Step 3: Build CRF-RNN custom op

Run `make` inside the `crfasrnn_keras/src/cpp` directory:
Run `setup.py` inside the `crfasrnn_pytorch/crfasrnn` directory:
```
$ cd crfasrnn_pytorch
$ 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](https://goo.gl/ciEYZi) or [here](https://github.com/sadeepj/crfasrnn_keras/releases/download/v1.0/crfrnn_keras_model.h5) and place it in the `crfasrnn_pytorch` directory with the file name `crfasrnn_weights.pth`.
Expand All @@ -63,4 +62,3 @@ $ cd crfasrnn_pytorch
$ python run_demo.py
```
If all goes well, you will see the segmentation results in a file named "labels.png".

0 comments on commit 8838100

Please sign in to comment.