Giter VIP home page Giter VIP logo

unisal's Introduction

Unified Image and Video Saliency Modeling

This repository provides the code for the paper:

Richard Droste, Jianbo Jiao and J. Alison Noble. Unified Image and Video Saliency Modeling. In: ECCV (2020).

If you use UNISAL, please cite the following BibTeX entry:

@inproceedings{drostejiao2020,
     author = {{Droste}, Richard and {Jiao}, Jianbo and {Noble}, J. Alison},
      title = "{Unified Image and Video Saliency Modeling}",
  booktitle = {Proceedings of the 16th European Conference on Computer Vision (ECCV)},
       year = {2020},
}

Performance overview

Comparison of UNISAL with current state-of-the-art methods on the DHF1K Benchmark


Method

UNISAL method overview


Dependencies

To install the dependencies into a new conda environment, simpy run:

conda env create -f environment.yml
source activate unisal

Alternatively, you can install them manually:

conda create --name unisal
source activate unisal
conda install pytorch=1.0 torchvision cudatoolkit=9.2 -c pytorch
conda install opencv=3.4 -c conda-forge
conda install scipy
pip install fire==0.2 tensorboardX==1.6

Demo

We provide demo code that generates saliency predictions for example files from the DHF1K, Hollywood-2, UCF-Sports, SALICON and MIT1003 datasets. The predictions are generated with the pretrained weights in training_runs/pretrained_unisal.
Follow these steps:

  1. Download the following example files and extract the contents into the examples of the repository folder:
    Google Drive: .zip file or .tar.gz file
    Baidu Pan: .zip file (password: mp3y) or .tar.gz file (password: ixdd)

  2. Generate the demo predictions for the examples by running python run.py predict_examples

My own code. python run.py predict_examples_wk

The predictions are written to saliency sub-directories to the examples folders. But I saved my results in <my_bigdata_folder>/WF/Preds/<Dataset>/UNISAL/ to ease evaluation.


Training, scoring and test set predictions

The code for training and scoring the model and to generate test set predictions is included.

Data

For training and test set predictions, the relevant datasets need to be downloaded.

Specify the paths of the downloaded datasets with the environment variables DHF1K_DATA_DIR, SALICON_DATA_DIR, HOLLYWOOD_DATA_DIR, UCFSPORTS_DATA_DIR MIT300_DATA_DIR, MIT1003_DATA_DIR.

Training

To train the model, simpy run:

python run.py train

By default, this function computes the scores of the DHF1K and SALICON validation sets and the Hollywood-2 and UCF Sports test sets after the training is finished. The training data and scores are saved in the training_runs folder. Alternatively, the training path can be overwritten with the environment variable TRAIN_DIR.

Scoring

Any trained model can be scored with:

python run.py score_model --train_id <name of training folder>

If --train_id is omitted, the provided pre-trained model is scored. The scores are saved in the corresponding training folder.

Test set predictions

To generate predictions for the test set of each datasets follow these steps:

  1. Specify the directory where the predictions should be saved with the environment variable PRED_DIR.

  2. Generate the predictions by running python run.py generate_predictions --train_id <name of training folder>

If --train_id is omitted, predictions of the provided pretrained model are generated.

Calculate FLOPs

Run python run.py running_time

unisal's People

Contributors

ashleylqx avatar rdroste avatar jianbojiao avatar makbn avatar

Stargazers

 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.