All problems
Keypoint Confidence Threshold
Problem
Filter keypoints by confidence.
Each keypoint is [x, y, score]; keep the keypoints whose score is greater than or equal to threshold, preserving order. An empty list returns [].
Test cases
case 1
in: [[[1,2,0.9],[3,4,0.2],[5,6,0.5]],0.5]
expected: [[1,2,0.9],[5,6,0.5]]
case 2
in: [[[1,1,0.1]],0.5]
expected: []
case 3
in: [[[2,3,1]],1]
expected: [[2,3,1]]
Starter codePython
def filter_keypoints(keypoints, threshold):
# Your code here
pass3 test cases · run your code against them in the editor