View mlp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
# | |
#!/usr/bin/python2 | |
# | |
# Copyright 2013 Johannes Bauer, Universitaet Hamburg | |
# | |
# This file is free software. Do with it whatever you like. | |
# It comes with no warranty, explicit or implicit, whatsoever. | |
# | |
# If you find this code useful or if you have any questions, do not |
View som.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
# | |
#!/usr/bin/python2 | |
# | |
# Copyright 2013 Johannes Bauer, Universitaet Hamburg | |
# | |
# This file is free software. Do with it whatever you like. | |
# It comes with no warranty, explicit or implicit, whatsoever. | |
# | |
# This python script implements a simple SOM in arbitrary dimensions. |
View saliency.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
# | |
#!/usr/bin/python | |
# | |
# Copyright 2013 Johannes Bauer, Universitaet Hamburg | |
# | |
# This file is free software. Do with it whatever you like. | |
# It comes with no warranty, explicit or implicit, whatsoever. | |
# | |
# This python script implements an early version of Itti and Koch's |
View plot_rgb_as_pcolormesh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def plot_as_colormesh(image, axes, **pcolormeshkwargs): | |
raveled_pixel_shape = (image.shape[0]*image.shape[1], image.shape[2]) | |
color_tuple = image.transpose((1,0,2)).reshape(raveled_pixel_shape) | |
if color_tuple.dtype == np.uint8: | |
color_tuple = color_tuple / 255. | |
index = np.tile(np.arange(image.shape[0]), (image.shape[1],1)) |
View shrinkpdf.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 2 ] || [ $# -gt 3 ]; then | |
echo usage: shrinkpdf \<filename\> \<resolution\> \[\<output\>\] | |
exit | |
fi | |
if [ ! -e "$1" ]; then | |
echo "$1" does not exist. Exiting. | |
exit |