Finally, in this step we will find the matching celebrity image against the image we uploaded from the local computer. This is what the final output will look like:
Use the calculate_face_distance()
function to calculate the Euclidean distance between the faces:
matching_image = << your code goes here >>(known_encodings, original_image)[1]
Now, let us check which celebrity do you look like:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from matplotlib import rcParams
%matplotlib inline
# read images
img_1 = mpimg.imread(original_image)
img_2 = mpimg.imread('/cxldata/projects/lookalikeceleb/images/' + matching_image)
# display images
fig, ax = plt.subplots(1,2)
ax[0].imshow(img_1);
ax[1].imshow(img_2);
print('Hey, you look like ' + os.path.splitext(matching_image)[0] + '!')
Don't forget to share this on LinkedIn or your favorite Social Media website.
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...