This repository is the implementation of Revisiting Top-Down Flows for Salient Object Detection.
Note: Please clone this project and install required pytorch first
To install requirements:
pip install -r requirements.txt
Please select one of the links below to download pre-trained models
- BaiduDisk: (code: 1234)
- GoogleDisk
After downloading, put it into pretrained_model
folder
Please select one of the links below to download related Saliency Object Detection Dataset
- BaiduDisk: (code: 9ib7)
- GoogleDisk
After downloading, use 7z -x filepath
to extract 7z
file into current project folder
To train the model, run following commmands:
# train efficient-b3 backbone
python run.py -d DUTS -pretrain ./pretrained_model/efficientnet-b3-5fb5a3c3.pth -save efficient-b3 -optim Adam -epoch 210 -lr 4.5e-5 -gpu 0 -b 1 -crop 0 -step 10 -proc DNTD -weight_decay 0 -is_scale -random_bright --TRAIN_DOWN_ITER 0.8 -model_name efficientnet-b3
# train efficient-b0 backbone
python run.py -d DUTS -pretrain ./pretrained_model/efficientnet-b0-355c32eb.pth -save efficient-b0 -optim Adam -epoch 210 -lr 4.5e-5 -gpu 0 -b 1 -crop 0 -step 10 -proc DNTD -weight_decay 0 -is_scale -random_bright --TRAIN_DOWN_ITER 0.8 -model_name efficientnet-b0
# train resnet-50 backbone
python run.py -d DUTS -pretrain ./pretrained_model/resnet.pth -save resnet-scale-4 -epoch 210 -lr 1e-5 -gpu 0 -b 1 -crop 0 -step 10 -proc DNTD -weight_decay 0 -is_scale -random_bright --TRAIN_DOWN_ITER 0.8 -model_name resnet50 --RESNET_SCALE 4
Note:
The commands will automatically test and evaluate the trained model.
If you need not to evaluate, you can use the
-disable_eval
parameter.If you need not to test, you can use the
-disable_test
parameter.
-gpu
parameter is the GPU number that you use.(e.g.0
0,1
...)Evaluation code is embedded in this project.
If you want to evaluate all dataset, you can use the
-eval_d All
parameter.The evaluation result can be found in
logs/ExperimentalNotes.md
- To evaluate other trained model on the Saliency Object Detection Dataset, run:
python run.py -d DUTS -save efficient-b3 -model_name efficientnet-b3 -test_model ./dntd-efficient-b3.pth -disable_train -eval_d ALL
- If you want the obtained results using this project, you need to adapt your folder names to our required structure and put it into
logs
directory. Suppose your directory name is "SOD", you can specify-save SOD
and-disable_train -diabale_test
, then run the following command to evaluate
python run.py -d DUTS -save <Your folder name in log dir> -disable_train -disable_test -eval_d ALL
logs/
|-- <folder name>
| `-- test
| |-- SOD
| |-- DUTS
| `-- ...
You can download our pretrained SOD models here:
- BaiduDisk: (code: 1234)
- GoogleDisk
We also release our predicted saliency maps:
- BaiduDisk: (code: 1234)
- GoogleDisk