写一个简单的函数来展示一张图片和它对应的标注点作为例子。
def show_landmarks(image, landmarks): """显示带有地标的图片""" plt.imshow(image) plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r') plt.pause(0.001) # pause a bit so that plots are updated plt.figure() show_landmarks(io.imread(os.path.join('data/faces/', img_name)), landmarks) plt.show()