In [1]:
import numpy

In [2]:
X = numpy.load('../TEMP/X_94.npy')
landmarks = numpy.load('../TEMP/landmarks_94.npy')

In [3]:
import matplotlib.pyplot as plt
% matplotlib inline


/var/research/Code/virtualenvs/tensorflow_0_10_0/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

In [4]:
img = X[0, :, :, :].transpose(1, 2, 0)
print img.shape


(96, 96, 3)

In [5]:
plt.imshow(img)


Out[5]:
<matplotlib.image.AxesImage at 0x7f9d288f28d0>

In [7]:
pts = numpy.reshape(landmarks[0, :], (2, 68), 'F')
print pts.shape


(2, 68)

In [14]:
plt.scatter(pts[0, :], -pts[1, :])


Out[14]:
<matplotlib.collections.PathCollection at 0x7f9d053bb410>

In [12]:
plt.imshow(img)
plt.scatter(pts[0, :], pts[1, :])


Out[12]:
<matplotlib.collections.PathCollection at 0x7f9d2885b850>

In [19]:
def show_img_with_landmarks(X, landmarks, index):
    img = X[index, :, :, :].transpose(1, 2, 0)
    pts = numpy.reshape(landmarks[index, :], (2, 68), 'F')
    plt.scatter(pts[0, :], -pts[1, :])
    plt.show()
    
    plt.imshow(img)
    plt.scatter(pts[0, :], pts[1, :])
    plt.show()

In [22]:
for i in range(100):
    show_img_with_landmarks(X, landmarks, i)



In [ ]: