def im_detect_keypoints_hflip(model, im, target_scale, target_max_size, boxes): """Computes keypoint predictions on the horizontally flipped image. Function signature is the same as for im_detect_keypoints_aug. """ # Compute keypoints for the flipped image im_hf = im[:, ::-1, :] boxes_hf = box_utils.flip_boxes(boxes, im.shape[1]) im_scale = im_conv_body_only(model, im_hf, target_scale, target_max_size) heatmaps_hf = im_detect_keypoints(model, im_scale, boxes_hf) # Invert the predicted keypoints heatmaps_inv = keypoint_utils.flip_heatmaps(heatmaps_hf) return heatmaps_inv