0
0
Computer Visionml~10 mins

OpenPose overview 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 an OpenPose model using the OpenPose Python API.

Computer Vision
from openpose import pyopenpose as op
params = dict()
params["model_folder"] = "models/"
opWrapper = op.WrapperPython()
opWrapper.configure(params)
opWrapper.[1]()
Drag options to blanks, or click blank then click option'
Arun
Binit
Cload
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using run() instead of start(), which does not exist in the API.
Using load() which is not a method of the wrapper.
Using init() which is not the correct method name.
2fill in blank
medium

Complete the code to process an image and get the pose keypoints.

Computer Vision
datum = op.Datum()
datum.cvInputData = image
opWrapper.emplaceAndPop([[1]])
keypoints = datum.poseKeypoints
Drag options to blanks, or click blank then click option'
AopWrapper
Bdatum
Cparams
Dimage
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the image directly instead of the datum object.
Passing the wrapper or params which are not valid inputs here.
3fill in blank
hard

Fix the error in the code to correctly extract the number of detected people from pose keypoints.

Computer Vision
num_people = datum.poseKeypoints.[1] if datum.poseKeypoints is not None else 0
Drag options to blanks, or click blank then click option'
Ashape[0]
Blen()
Csize
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using len() which causes an error because poseKeypoints is a NumPy array, not a list.
Using size which gives total elements, not number of people.
Using count which is not a valid attribute.
4fill in blank
hard

Fill both blanks to create a dictionary of body part names and their 2D coordinates for the first detected person.

Computer Vision
body_parts = {name: (datum.poseKeypoints[0, idx, [1]], datum.poseKeypoints[0, idx, [2]]) for idx, name in enumerate(body_part_names)}
Drag options to blanks, or click blank then click option'
A0
B1
C2
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping x and y indices.
Using index 2 which is confidence, not coordinate.
5fill in blank
hard

Fill all three blanks to filter detected people with confidence above 0.5 and create a list of their nose coordinates.

Computer Vision
nose_coords = [datum.poseKeypoints[i, nose_idx, [1]] for i in range(datum.poseKeypoints.shape[0]) if datum.poseKeypoints[i, nose_idx, [2]] > [3]]
Drag options to blanks, or click blank then click option'
A0
B2
C0.5
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong indices for coordinates or confidence.
Using a confidence threshold other than 0.5.