%matplotlib inline
import pyhog
import numpy as np
import matplotlib.pyplot as pl
from scipy.misc import imread, imrotate
# just a random VOC2012 image
img = (imread('2007_006449.jpg').astype(np.float64)/255.0)
pl.imshow(img)
pl.axis('off')
(-0.5, 499.5, 374.5, -0.5)
hog = pyhog.features_pedro(img, 30)
hog.shape
(11, 15, 31)
hog_pic = pyhog.hog_picture(hog)
pl.gray()
pl.imshow(hog_pic, vmin=0.0, vmax=3.0) # clip a bit for visibility
pl.axis('off')
(-0.5, 299.5, 219.5, -0.5)