RAS-pytorch
Pytorch realization for "Reverse Attention for Salient Object Detection": ECCV2018.
Preview
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.
- 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
- 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)
- Running test using python3:
python3 test.py
Training
- Edit ./train.py in your project:
def get_train_data(start_image_id, end_image_id):
"""
add your load_data code here.
"""
- Running train using python3:
python3 train.py
Validation
- Edit ./val.py in your project:
def get_val_data(start_image_id, end_image_id):
"""
add your load_data code here.
"""
- Running validation using python3:
python3 val.py