def METHOD_NAME(self, proposals, targets):
    labels = []
    keypoints = []
    for proposals_per_image, targets_per_image in zip(proposals, targets):
        matched_targets = self.match_targets_to_proposals(
            proposals_per_image, targets_per_image
        )
        matched_idxs = matched_targets.get_field("matched_idxs")
        labels_per_image = matched_targets.get_field("labels")
        labels_per_image = labels_per_image.to(dtype=torch.int64)
        # this can probably be removed, but is left here for clarity
        # and completeness
        # TODO check if this is the right one, as BELOW_THRESHOLD
        neg_inds = matched_idxs == Matcher.BELOW_LOW_THRESHOLD
        labels_per_image[neg_inds] = 0
        keypoints_per_image = matched_targets.get_field("keypoints")
        within_box = _within_box(
            keypoints_per_image.keypoints, matched_targets.bbox
        )
        vis_kp = keypoints_per_image.keypoints[..., 2] > 0
        is_visible = (within_box & vis_kp).sum(1) > 0
        labels_per_image[~is_visible] = -1
        labels.append(labels_per_image)
        keypoints.append(keypoints_per_image)
    return labels, keypoints