0
0
Computer Visionml~10 mins

Hand and face landmark detection 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 import the MediaPipe Hands solution.

Computer Vision
import mediapipe as mp
mp_hands = mp.solutions.[1]
Drag options to blanks, or click blank then click option'
Ahands
Bface_mesh
Cdrawing_utils
Dpose
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'face_mesh' instead of 'hands' for hand detection.
Using 'pose' which is for body pose estimation.
Using 'drawing_utils' which is for drawing landmarks, not detection.
2fill in blank
medium

Complete the code to initialize the Hands model with static image mode enabled.

Computer Vision
with mp_hands.Hands(static_image_mode=[1], max_num_hands=2) as hands:
Drag options to blanks, or click blank then click option'
AFalse
BNone
CTrue
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting static_image_mode to False when processing single images.
Using None or 0 which are invalid for this parameter.
3fill in blank
hard

Fix the error in accessing the hand landmarks from the results object.

Computer Vision
if results.[1]:
    for hand_landmarks in results.multi_hand_landmarks:
        print(hand_landmarks)
Drag options to blanks, or click blank then click option'
Amulti_hand_landmarks
Bhand_landmarks
Clandmarks
Dmulti_landmarks
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hand_landmarks' which is not an attribute of results.
Using 'landmarks' or 'multi_landmarks' which do not exist.
4fill in blank
hard

Fill both blanks to draw hand landmarks on the image using MediaPipe drawing utilities.

Computer Vision
mp_drawing.[1](image, hand_landmarks, mp_hands.[2])
Drag options to blanks, or click blank then click option'
Adraw_landmarks
Bdraw_detection
CHAND_CONNECTIONS
Dface_mesh
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'draw_detection' which is for object detection, not landmarks.
Using 'face_mesh' which is unrelated to hands.
5fill in blank
hard

Fill all three blanks to create a dictionary of landmark coordinates normalized to image size.

Computer Vision
landmark_dict = [1]: {'x': [2].x * image_width, 'y': [2].y * image_height} for [1], [2] in [3](hand_landmarks.landmark)
Drag options to blanks, or click blank then click option'
Ai
Blandmark_dict
Cenumerate
Didx
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'landmark_dict' as a variable inside the comprehension.
Mixing variable names inconsistently.
Not using 'enumerate' to get index and value.