Skip to content

new-stone-object/DNTD

Repository files navigation

Revisiting Top-Down Flows for Salient Object Detection

This repository is the implementation of Revisiting Top-Down Flows for Salient Object Detection.

Prerequisites

Requirements

Note: Please clone this project and install required pytorch first

To install requirements:

pip install -r requirements.txt

Backbone pre-trained model download

Please select one of the links below to download pre-trained models

After downloading, put it into pretrained_model folder

Dataset download

Please select one of the links below to download related Saliency Object Detection Dataset

After downloading, use 7z -x filepath to extract 7z file into current project folder

Train and test

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:

  1. 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.

  2. -gpu parameter is the GPU number that you use.(e.g. 0 0,1...)

  3. Evaluation code is embedded in this project.

    If you want to evaluate all dataset, you can use the -eval_d All parameter.

  4. The evaluation result can be found in logs/ExperimentalNotes.md

Evaluation

  • 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 

Required evaluation folder structure

logs/
|-- <folder name>
|   `-- test
|       |-- SOD
|       |-- DUTS
|       `-- ...

Pre-trained SOD Models and Predicted Saliency map

You can download our pretrained SOD models here:

We also release our predicted saliency maps:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages