def METHOD_NAME(model, loader, post_prediction_callback, sigmas, metric: Optional[PoseEstimationMetrics] = None):
    samples = []
    for inputs, targets, extras in tqdm(loader):
        with torch.no_grad(), torch.cuda.amp.autocast(True):
            predictions = model(inputs.cuda(non_blocking=True))
            all_poses, all_scores = post_prediction_callback(predictions)
        if metric is not None:
            metric.update(predictions, targets, **extras)
        batch_size = len(inputs)
        for image_index in range(batch_size):
            pred_poses = all_poses[image_index]  # [M, J, 3]
            pred_scores = all_scores[image_index]  # [M]
            gt_iscrowd = extras["gt_iscrowd"][image_index]
            gt_keypoints = extras["gt_joints"][image_index]  # [N, J, 3]
            gt_bboxes = extras["gt_bboxes"][image_index]  # [N, 4]
            gt_areas = extras["gt_areas"][image_index]  # [N]
            # Filter out poses with no visible keypoints
            if len(gt_keypoints) > 0 and len(pred_poses) > 0:
                gt_keypoints_xy = gt_keypoints[:, :, 0:2]
                gt_keypoints_visibility = gt_keypoints[:, :, 2]
                iou = compute_oks(
                    pred_joints=torch.from_numpy(pred_poses),
                    gt_joints=torch.from_numpy(gt_keypoints_xy),
                    gt_keypoint_visibility=torch.from_numpy(gt_keypoints_visibility),
                    sigmas=sigmas,
                    gt_bboxes=torch.from_numpy(gt_bboxes),
                )
                # Here we are not interested in solving the MxN matching problem, but rather
                # in getting the largest IoU for each predicted pose with the ground truth poses.
                max_iou = iou.max(axis=1).values.numpy()  # [M]
            else:
                max_iou = np.zeros(len(pred_poses), dtype=np.float32)
            sample = {
                "pred_poses": pred_poses,
                "pred_scores": pred_scores,
                # Targets
                "iou": max_iou,
                #
                "gt_bboxes": gt_bboxes,
                "gt_joints": gt_keypoints,
                "gt_iscrowd": gt_iscrowd,
                "gt_areas": gt_areas,
            }
            samples.append(sample)
    return samples