Git Product home page Git Product logo

opensalicon's Introduction

OpenSALICON

OpenSALICON is an open source implementation of the SALICON saliency model cited below.

Huang, X., Shen, C., Boix, X., & Zhao, Q. (2015). SALICON: Reducing the Semantic Gap in Saliency Prediction by Adapting Deep Neural Networks. In Proceedings of the IEEE International Conference on Computer Vision (pp. 262-270).

Citing OpenSALICON

A technical report describing our implementation is provided (salicon.pdf). If you find OpenSALICON useful in your research, please cite our technical report:

@TECHREPORT {christopherleethomas2016,
    author      = {Christopher Lee Thomas},
    title       = {OpenSalicon: An Open Source Implementation of the Salicon Saliency Model},
    institution = {University of Pittsburgh},
    year        = {2016},
    number      = {TR-2016-02}
}

Using OpenSALICON

Requirements: software
  1. Requirements for Caffe and pycaffe (see: Caffe installation instructions)

Note: Caffe must be built with support for Python layers!

# In your Makefile.config, make sure to have this line uncommented
WITH_PYTHON_LAYER := 1
  1. Python packages you might not have: numpy, PIL, matplotlib, scipy
Basic Demo (producing saliency maps from images)
  1. Edit the Salicon.py file to include the path to your caffe python install where indicated (i.e. update the line below to the path containing your caffe installation):

        sys.path.insert(0, 'caffe/install/python') # PATH TO CAFFE PYTHON INSTALL

    Additionally, depending on whether you are using a GPU or not, you may need to edit the following two lines:

    caffe.set_mode_gpu()
    caffe.set_device(1)

    If you do not have a CPU, be sure to remove the set_device(1) line and change the mode selection to caffe.set_mode_cpu(). Depending on your setup, you may need to change the device ID from 1 to 0 or some other number depending on your hardware configuration.

  2. Download the caffemodel files using this link. Place the caffemodel files into the same directory as the code (unless you manually modify the paths to point to the directory containing the caffemodel files).

  3. The following commands should allow you to compute the saliency map for an image using the pretrained model. IMPORTANT: When using on your own data, ensure that your data is in 256 RGB format. If it is not, you will need to manually do some pre-processing first.

  4. Run python and execute the following commands:

    from Salicon import Salicon
    sal = Salicon()
    map = sal.compute_saliency('face.jpg')
    # map contains saliency map in double format.

    Original Image Resulting Map

  5. You can then perform thresholding (if you prefer) on the output or use it directly.

Training your own model

Use the finetune_salicon.py file to train your own model. See our technical report for more details on how to do this. We provide two solvers solver.prototxt and solver_new.prototxt for this purpose. Solver_new attempts to use ADADELTA to adjust the learning rate dynamically. finetune_salicon.prototxt provides a model definition file for our implementation in which you can adjust learning rates per layer and more customization. Our finetune_salicon.py file provides the basic functionality of reading in the input images and fixation maps, initializing the solver, loading the data in batches, solving the model, and saving the results. You may need to adjust the solver to your particular dataset.

Parting Words

OpenSALICON performs on-par with the results produced by the official SALICON demo website when compared using AUC scores to ground truth human fixations. If you have any questions, discover any bugs, or make improvements to this code, please feel free to create an issue or push request.

opensalicon's People

Contributors

clt29 avatar

Watchers

James Cloos avatar  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.