Source code for our paper "How Many Glances? Modeling Multi-duration Saliency".
This repo contains models and source code for predicting multi-duration saliency and its applications.
To get started, download the CodeCharts1k multi-duration saliency dataset. Please see the README contained in the CodeCharts1k zip file for a detailed description of its contents.
To perform inference on a few images, we provide the mdsem_simple_inference.ipynb notebook, where our pretrained checkpoints on codecharts and salicon can be loaded and saliency maps can be generated from a few test images.
To run this notebook:
- Clone the repository
- Place your test images in the
images/folder. - Download the checkpoints from our website (codecharts_checkpoint, salicon-md checkpoint and place them in a folder named
ckpt/. - Run the notebook.
src/multiduration_models.py: model definitions for multi-duration models.src/singleduration_models.py: model definitions for single-duration models.src/losses_keras2.py: loss functions used in trainingsrc/data_loading.py: helper functions to load saliency data setssrc/eval.py: helper functions for evaluating models on common saliency metrics and saving predictionssrc/util.py: utilities for loading models and losses
Use the notebook notebooks/plot_mdsem_predictions.ipynb to plot predictions from MD-SEM.
Please see the applications folder for the source code for our multi-duration saliency applications.
If you want to test out the applications without running the MD-SEM model, you can download the MD-SEM predictions here.