Skip to content

Pytorch realization for "Reverse Attention for Salient Object Detection": ECCV2018.

License

Notifications You must be signed in to change notification settings

vc-nju/RAS_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAS-pytorch

Pytorch realization for "Reverse Attention for Salient Object Detection": ECCV2018.

Preview

Origin_photo Saliency_map

Feature

RAS_pytorch is a pytorch version for the paper mentioned above.

We have trained and tested on MSRA-B, and it's auc is 0.976.

Requirements

  • python 3.5+
  • opencv 3.0+
  • pytorch 0.4+

Installation

git clone https://github.com/vc-nju/RAS_python.git && cd RAS_python
mkdir data && mkdir data/model && mkdir data/visualization

The pre_train models can be downloaded from Google Drive and BaiduYun(passcode: gnrg). Please copy them to data/model/

Test Zoo

Let's take a look at a quick example.

  1. Make sure you have downloaded the models and copy them to data/model/

Your data/model should be like this:

drfi_python
└───data
    └───model
        |  epoch_99_params.pkl
  1. Edit ./test.py module in your project:
    # img_path and id can be replaced by yourself.
    TEST_ID = 914
    ...
    im_path = "data/test/{}.jpg".format(TEST_ID)
    gt_path = "data/test/{}.png".format(TEST_ID)
  1. Running test using python3:
python3 test.py

Training

  1. Edit ./train.py in your project:
def get_train_data(start_image_id, end_image_id):
    """
    add your load_data code here.
    """
  1. Running train using python3:
python3 train.py

Validation

  1. Edit ./val.py in your project:
def get_val_data(start_image_id, end_image_id):
    """
    add your load_data code here.
    """
  1. Running validation using python3:
python3 val.py

About

Pytorch realization for "Reverse Attention for Salient Object Detection": ECCV2018.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages