Project- Find the Celebrity who Looks like You using Computer Vision

8 / 8

Celebrity Look-alike with Computer Vision - Find the Matching Celebrity Image

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:

enter image description here

INSTRUCTIONS
  1. 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]
    
  2. 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] + '!')
    
  3. Don't forget to share this on LinkedIn or your favorite Social Media website.

See Answer

No hints are availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...