Giter Club home page Giter Club logo

saliency-evaluation-toolbox's Introduction

Saliency-Evaluation-Toolbox

This repository contains measures for evaluating salient object detection models in python.

Requirements

Usage

Simply import calculate_measures, set Saliency Maps and Ground Truth paths, and choose measures you would like to be calculated (measures: 'MAE', 'E-measure', 'S-measure', 'Max-F', 'Adp-F', 'Wgt-F'). All results can be saved as numpy arrays by specifying save parameter.

>>> from saliency_toolbox import calculate_measures
>>> sm_dir = 'SM/'
>>> gt_dir = 'GT/'
>>> res    = calculate_measures(gt_dir, sm_dir, ['E-measure', 'S-measure', 'Wgt-F'], save=False)
>>> print(res)

{'E-measure': 0.990753, 'S-measure': 0.958684, 'Wgt-F': 0.974209}

To plot F-measure and Precision-Recall curves, firstly, Max-F should be calculated and stored (by specifying save). This results in storing Precision.npy, Recall.npy and Fmeasure_all_thresholds.npy, and then we can use them to plot curves. For example:

>>> res       = calculate_measures(gt_dir, sm_dir, ['Max-F'], save='./')
>>> prec      = np.load('save/Precision.npy')
>>> recall    = np.load('save/Recall.npy')
>>> f_measure = np.load('save/Fmeasure_all_thresholds.npy')
>>> plt.plot(recall, prec)
>>> plt.figure()
>>> plt.plot(np.linspace(0, 1, len(f_measure)), f_measure) 

Citation

@article{mohammadi2020cagnet,
  title={CAGNet: Content-Aware Guidance for Salient Object Detection},
  author={Mohammadi, Sina and Noori, Mehrdad and Bahri, Ali and Majelan, Sina Ghofrani and Havaei, Mohammad},
  journal={Pattern Recognition},
  pages={107303},
  year={2020},
  publisher={Elsevier}
}
@article{noori2020dfnet,
  title={DFNet: Discriminative feature extraction and integration network for salient object detection},
  author={Noori, Mehrdad and Mohammadi, Sina and Majelan, Sina Ghofrani and Bahri, Ali and Havaei, Mohammad},
  journal={Engineering Applications of Artificial Intelligence},
  volume={89},
  pages={103419},
  year={2020},
  publisher={Elsevier}
}

saliency-evaluation-toolbox's People

Contributors

mehrdad-noori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.