In [2]:
%matplotlib inline

In [2]:
import pyhog
import numpy as np
import matplotlib.pyplot as pl
from scipy.misc import imread, imrotate

In [5]:
# just a random VOC2012 image
img = (imread('2007_006449.jpg').astype(np.float64)/255.0)
pl.imshow(img)
pl.axis('off')


Out[5]:
(-0.5, 499.5, 374.5, -0.5)

In [6]:
hog = pyhog.features_pedro(img, 30)
hog.shape


Out[6]:
(11, 15, 31)

In [7]:
hog_pic = pyhog.hog_picture(hog)

In [8]:
pl.gray()
pl.imshow(hog_pic, vmin=0.0, vmax=3.0) # clip a bit for visibility
pl.axis('off')


Out[8]:
(-0.5, 299.5, 219.5, -0.5)