GithubHelp home page GithubHelp logo

sunwj / scanpath Goto Github PK

View Code? Open in Web Editor NEW
27.0 5.0 3.0 901 KB

Visual Scanpath Prediction using IOR-ROI Recurrent Mixture Density Network

License: GNU Lesser General Public License v3.0

Python 100.00%

scanpath's Introduction

Visual Scanpath Prediction

Pytorch implementation of the paper "Visual Scanpath Prediction using IOR-ROI Recurrent Mixture Density Network"

Models

There are four major components presented in the model: an image feature extractor, the ROI generation module, the fixation duration prediction module and a saliency guidance network. Given an input image, the image feature extractor is responsible for extracting deep convolutional features and semantic features using off-the-shelf CNN architectures. The ROI generation module is composed of IOR-ROI LSTM and the MDN. The IOR-ROI LSTM plays a critical role in modeling the IOR dynamics and attention shift behavior. Instead of predicting a unique ROI in a deterministic manner for each step, the MDN is used to generate the distribution of ROIs as GMs. The next fixation is sampled from the mixture distribution of Gaussians to model the stochastic of human saccadic behavior. The fixation duration prediction module predicts fixation duration as a Gaussian distribution whose parameters are regressed by a fully connected neural network. The saliency guidance network is only employed during the training phase, encouraging the feature extractor to encode more saliency information in convolutional features.

Run the code

To run the code, you need to download the pre-trained models from here and extract the files to the data folder in the root directory.

# get the source code
git clone https://github.com/sunwj/scanpath.git

# run the code
python3 eval.py -i image_file -s semantic_file

# example
python3 eval.py -i ./sample_images/img1.jpg -s ./sample_images/img1.npy

The generated scanpaths are saved in the results folder.

Sample results

We provide images and semantic features for the OSIE dataset which can be downloaded from here. The semantic features are extracted using the code and pre-trained models, you can use the code to extract semantic features of other images.

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.