Skip to content

Instantly share code, notes, and snippets.

Johannes Bauer tatome

View GitHub Profile
View mlp.py
# 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
# 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.
@tatome
tatome / saliency.py
Created Feb 11, 2016
Simple Itty-Koch-Style Saliency Maps
View saliency.py
# 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
@tatome
tatome / plot_rgb_as_pcolormesh
Last active Aug 29, 2015
Plot any RGB image as as pcolormesh in matplotlib's pcolormesh
View plot_rgb_as_pcolormesh
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
#!/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
You can’t perform that action at this time.