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
In [4]:
img = X[0, :, :, :].transpose(1, 2, 0)
print img.shape
In [5]:
plt.imshow(img)
Out[5]:
In [7]:
pts = numpy.reshape(landmarks[0, :], (2, 68), 'F')
print pts.shape
In [14]:
plt.scatter(pts[0, :], -pts[1, :])
Out[14]:
In [12]:
plt.imshow(img)
plt.scatter(pts[0, :], pts[1, :])
Out[12]:
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 [ ]: