def detect_keypoints(scoremaps):
    ' Performs detection per scoremap for the hands keypoints. '
    if (len(scoremaps.shape) == 4):
        scoremaps = np.squeeze(scoremaps)
    s = scoremaps.shape
    assert (len(s) == 3), 'This function was only designed for 3D Scoremaps.'
    assert ((s[2] < s[1]) and (s[2] < s[0])), 'Probably the input is not correct, because [H, W, C] is expected.'
    keypoint_coords = np.zeros((s[2], 2))
    for i in range(s[2]):
        (v, u) = np.unravel_index(np.argmax(scoremaps[:, :, i]), (s[0], s[1]))
        keypoint_coords[(i, 0)] = v
        keypoint_coords[(i, 1)] = u
    return keypoint_coords
Performs detection per scoremap for the hands keypoints.
def detect_keypoints(scoremaps):
    '  '
    if (len(scoremaps.shape) == 4):
        scoremaps = np.squeeze(scoremaps)
    s = scoremaps.shape
    assert (len(s) == 3), 'This function was only designed for 3D Scoremaps.'
    assert ((s[2] < s[1]) and (s[2] < s[0])), 'Probably the input is not correct, because [H, W, C] is expected.'
    keypoint_coords = np.zeros((s[2], 2))
    for i in range(s[2]):
        (v, u) = np.unravel_index(np.argmax(scoremaps[:, :, i]), (s[0], s[1]))
        keypoint_coords[(i, 0)] = v
        keypoint_coords[(i, 1)] = u
    return keypoint_coords