diff --git a/models/handpose_estimation_mediapipe/mp_handpose.py b/models/handpose_estimation_mediapipe/mp_handpose.py index 0f93845a24f2016abddb9ae846ae3f80609892e7..826027c2233a3c83b33819ee60c77216aee220c5 100644 --- a/models/handpose_estimation_mediapipe/mp_handpose.py +++ b/models/handpose_estimation_mediapipe/mp_handpose.py @@ -54,8 +54,8 @@ class MPHandPose: center_palm_bbox - new_half_size, center_palm_bbox + new_half_size]) palm_bbox = palm_bbox.astype(np.int32) - palm_bbox[:][0] = np.clip(palm_bbox[:][0], 0, image.shape[0]) - palm_bbox[:][1] = np.clip(palm_bbox[:][1], 0, image.shape[1]) + palm_bbox[:, 0] = np.clip(palm_bbox[:, 0], 0, image.shape[0]) + palm_bbox[:, 1] = np.clip(palm_bbox[:, 1], 0, image.shape[1]) # crop to the size of interest image = image[palm_bbox[0][1]:palm_bbox[1][1], palm_bbox[0][0]:palm_bbox[1][0], :] # pad to ensure conner pixels won't be cropped