Imported from https://github.com/alexanderkroner/saliency