MinglangQiao / pytorch-rsdnet-sor

PyTorch implementation of "Revisiting Salient Object Detection: Simultaneous Detection, Ranking, and Subitizing of Multiple Salient Objects", CVPR 2018

Home Page:https://github.com/islamamirul/rsdnet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rsdnet-pytorch

A pytorch implementation of rsdnet for the paper:

Revisiting Salient Object Detection: Simultaneous Detection, Ranking, and Subitizing of Multiple Salient Objects, Presented at CVPR 2018

image

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.

Dependency

python 3.6 
pytorch 1.4
opencv-python

Install them by the requirements.txt

pip install -r requirements.txt

Model

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.

Test

Put the model in proper dictionary and set the model, input and output path in model.py, then run

python test_net.py

Comparison

Quantitative result

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.

Saliency map

Comparison with the caffe version. image

Check list

  • Test code in pytorch
  • Recover the original image size as input
  • performance comparison of pytorch and caffe version
  • Training code in pytorch

Results

The results of the pytorch-rsdnet on PASCAL-S could be download from [Baidu pan, key:fnpr].

Reference

[1] islamamirul/rsdnet
[2] Caffe转Pytorch模型系列教程 概述
[3] kazuto1011/deeplab-pytorch

About

PyTorch implementation of "Revisiting Salient Object Detection: Simultaneous Detection, Ranking, and Subitizing of Multiple Salient Objects", CVPR 2018

https://github.com/islamamirul/rsdnet


Languages

Language:Python 100.0%