0
0
Computer Visionml~10 mins

Face embedding and comparison in Computer Vision - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load a face embedding model using a common deep learning library.

Computer Vision
model = [1]('facenet_keras.h5')
Drag options to blanks, or click blank then click option'
Aload_model
Bfit
Ccompile
Dpredict
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fit' instead of 'load_model' which tries to train the model.
Using 'predict' which runs the model but does not load it.
2fill in blank
medium

Complete the code to preprocess a face image before embedding extraction.

Computer Vision
preprocessed_face = face_image[1](size=(160, 160))
Drag options to blanks, or click blank then click option'
Arotate
Bnormalize
Cresize
Dcrop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'normalize' which changes pixel values but not size.
Using 'crop' which cuts part of the image but may not resize.
3fill in blank
hard

Fix the error in the code to compute the Euclidean distance between two face embeddings.

Computer Vision
distance = np.linalg.norm(embedding1 [1] embedding2)
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' which sums vectors instead of finding difference.
Using '*' or '/' which do element-wise multiplication or division.
4fill in blank
hard

Fill both blanks to create a dictionary of face embeddings for a list of face images.

Computer Vision
embeddings = {face_id: model.[1]([2](face)) for face_id, face in faces.items()}
Drag options to blanks, or click blank then click option'
Apredict
Bresize
Cpreprocess_input
Dfit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fit' which trains the model instead of predicting.
Using 'resize' as a model method which is incorrect.
5fill in blank
hard

Fill all three blanks to compare two face embeddings and decide if they match based on a threshold.

Computer Vision
distance = np.linalg.norm(embedding1 [1] embedding2)
match = distance [2] threshold
result = 'Match' if match else [3]
Drag options to blanks, or click blank then click option'
A-
B<=
C'No Match'
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' instead of '-' for distance calculation.
Using '>' instead of '<=' for threshold comparison.
Returning a boolean instead of a string for result.