An unofficial implementation of Non-Local Deep Features for Salient Object Detection.
The official Tensorflow version: NLDF
Some thing difference:
dataset- score with one channel, rather than two channels
- Dice IOU: boundary version and area version
- Python 3
- Pytorch 1.0
- torchvision
- visdom (optional for visualization)
The information of Loss:
Performance:
| Dataset | max F(paper) | MAE(paper) | max F(here) | MAE(here) |
|---|---|---|---|---|
| MSRA-B | 0.911 | 0.048 | 0.9006 | 0.0592 |
Note:
- only training 200 epoch, larger epoch may nearly the original paper
- This reproduction use area IOU, and original paper use boundary IOU
it's unfairness to this compare. (Different training data, I can not find the dataset use in original paper )
git clone git@github.com:AceCoooool/NLDF-pytorch.git cd NLDF-pytorch/Note: the original paper use other datasets.
Download the ECSSD dataset.
bash download.shcd tools/ python extract_vgg.py cd ..python demo.py --demo_img='your_picture' --trained_model='pre_trained pth' --cuda=TrueNote:
- default choose: download and copy the pretrained model to
weightsdirectory. - a demo picture is in
png/demo.jpg
python main.py --mode='train' --train_path='you_data' --label_path='you_label' --batch_size=8 --visdom=True --area=TrueNote:
--area=True, --boundary=Truearea and boundary Dice IOU (default:--area=True --boundary=False)--val=Trueadd the validation (but your need to add the--val_pathand--val_label)you_data, you_labelmeans your training data root. (connect to the step 2)
python main.py --mode='test', --test_path='you_data' --test_label='your_label' --batch_size=1 --model='your_trained_model'Note:
- use the same evaluation (this is a reproduction from original achievement)
- The boundary Dice IOU may cause
inf,it is better to use area Dice IOU.
Maybe, it is better to add Batch Normalization.

