Created
October 20, 2014 14:00
-
-
Save patricksnape/78b80a633354ee563bba to your computer and use it in GitHub Desktop.
Seminar 20/10/2014
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
def blue_peter(): | |
import menpo.io as mio | |
import h5it | |
from menpo.visualize.image import glyph | |
from menpo.feature import hog | |
import matplotlib.pyplot as plt | |
# Loading the pre-built HOG AAM | |
import cPickle as pickle | |
with open('/Users/pts08/hog_lfpw_aam.pkl', 'rb') as f: | |
hog_aam = pickle.load(f) | |
#hog_aam = h5it.load('/Users/pts08/sparse_hog.hdf5') | |
print('Here is one I made earlier!') | |
bp = mio.import_image('blue_peter.jpg') | |
hog_blue_peter = hog(bp) | |
plt.figure() | |
plt.subplot(121) | |
bp.view() | |
plt.axis('off') | |
plt.gcf().set_size_inches(11, 11) | |
plt.title('RGB') | |
plt.subplot(122) | |
glyph(hog_blue_peter).view() | |
plt.axis('off') | |
plt.gcf().set_size_inches(11, 11) | |
plt.title('HOG') | |
return hog_aam |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment