Salient Object Detection using Edge Guidance Network
We use the salMask2edge.m (require Matlab IDE) to generate the edge label for training.
-
Clone this code by
git clone https://github.com/varshapwalia/salient_object_detection.git -
Run
pip install -r requirementsto download libraries required to run the code. -
Download any saliency training data, we used DUTS-TR data :
- DUTS Image Dataset [10,553 training images]
-
Download intial model for Resnet50 (google_drive);
-
Create 2 lists using script createTrainList.py (change paths to your datasets).
- First list train.lst will be used in salMask2edge.m to create edge label for training data.
- 2nd list train_pair_edge.lst will be used in dataset.py.
-
Change the image path and intial model path in run.py and dataset.py;
-
Start to train with
python3 run.py --mode train. (30 epochs can take between 12hrs (RTX 4080) to 60hr (RTX 3060))
-
Use the model Trained above. You can use the pretrained weights as well.
-
Download Test Dataset, we compared 2 datasets for our model:
-
Create a list of dataset using script createTestList.py (change paths to your datasets). and use test.lst generated in dataset.py
-
Change the test image path in dataset.py
-
Generate saliency maps for SOD dataset by
python3 run.py --mode test -
Evaluate Results using the public open source code SOD Evaluation Metrics (f-measure, roc, precision etc).