A pytorch implementation of rsdnet for the paper:
This repository is based on the caffe version of rsdnet by Islam. Since building of caffe is not easy, I built this repository for more convenient usage of rsdnet.
python 3.6
pytorch 1.4
opencv-python
Install them by the requirements.txt
pip install -r requirements.txt
Download the pytorch model from Dropbox(key: sorrank) or BaiduPan(key: 652f), which is converted from the original caffe model by scripts caffe2pytorch.py and utils.py.
Put the model in proper dictionary and set the model, input and output path in model.py, then run
python test_net.py
Model | SOR ↑ | MAE ↓ | Inference time (s) ↓ |
---|---|---|---|
rsdnet-caffe | 0.8250 | 0.0910 | 0.063 |
rsdnet-pytorch | 0.8280 | 0.0910 | 0.302 |
-
Results are evaluated on a V100 GPU for all 425 test images of PASCAL-S. As can be seen, the pytorch implementation has slightly higher SOR and same MAE, through slower inference speed.
-
The difference is introduced by different implementations of caffe Interp layer of DeepLab and Pytorch bilinear interpolation. I tried Opencv, PIL and Pytorch bilinear method, and find that the pytorch version is the best one.
Comparison with the caffe version.
- Test code in pytorch
- Recover the original image size as input
- performance comparison of pytorch and caffe version
- Training code in pytorch
The results of the pytorch-rsdnet on PASCAL-S could be download from [Baidu pan, key:fnpr].
[1] islamamirul/rsdnet
[2] Caffe转Pytorch模型系列教程 概述
[3] kazuto1011/deeplab-pytorch