In [17]:
import matplotlib.pyplot as plt
import os
import pandas as pd
from skimage import io, transform

In [2]:
landmarks_frame = pd.read_csv('data/face_landmarks.csv')

In [9]:
n = 65
img_name = landmarks_frame.iloc[n, 0]

In [4]:
landmarks = landmarks_frame.iloc[n, 1:].as_matrix()

In [6]:
landmarks = landmarks.astype('float').reshape(-1, 2)

In [10]:
print('Image name: {}'.format(img_name))
print('Landmarks shape: {}'.format(landmarks.shape))
print('First 4 Landmarks: {}'.format(landmarks[:4]))


Image name: person-7.jpg
Landmarks shape: (68, 2)
First 4 Landmarks: [[ 32.  65.]
 [ 33.  76.]
 [ 34.  86.]
 [ 34.  97.]]

In [20]:
def show_landmarks(image, landmarks):
    """Show image with landmarks"""
    plt.imshow(image)
    plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r')

In [21]:
plt.figure()
show_landmarks(io.imread(os.path.join('data/', img_name)),
               landmarks)
plt.show()



In [ ]: