def METHOD_NAME(
    self,
    max_probs: torch.Tensor,
    seq: torch.Tensor,
    data_sample: Optional[TextSpottingDataSample] = None,
) -> Tuple[List[List[int]], List[List[float]], List[Tuple[float]],
           List[Tuple[float]]]:
    """Convert the output probabilities of a single image to character
    indexes, character scores, points and point scores.
    Args:
        max_probs (torch.Tensor): Character probabilities with shape
            :math:`(T)`.
        seq (torch.Tensor): Sequence indexes with shape
            :math:`(T)`.
        data_sample (TextSpottingDataSample, optional): Datasample of an
            image. Defaults to None.
    Returns:
        tuple(list[list[int]], list[list[float]], list[(float, float)],
        list(float, float)): character indexes, character scores, points
        and point scores. Each has len of max_seq_len.
    """
    h, w = data_sample.img_shape
    # the if is not a must since the softmaxed are masked out in decoder
    # if len(max_probs) % 27 != 0:
    #     max_probs = max_probs[:-len(max_probs) % 27]
    #     seq = seq[:-len(seq) % 27]
    # max_value, max_idx = torch.max(max_probs, -1)
    max_probs = max_probs.reshape(-1, 27)
    seq = seq.reshape(-1, 27)
    indexes, text_scores, points, pt_scores = [], [], [], []
    output_indexes = seq.cpu().detach().numpy().tolist()
    output_scores = max_probs.cpu().detach().numpy().tolist()
    for output_index, output_score in zip(output_indexes, output_scores):
        # work for multi-batch
        # if output_index[0] == self.dictionary.seq_end_idx +self.num_bins:
        #     break
        point_x = output_index[0] / self.num_bins * w
        point_y = output_index[1] / self.num_bins * h
        points.append((point_x, point_y))
        pt_scores.append(
            np.mean([
                output_score[0],
                output_score[1],
            ]).item())
        indexes.append([])
        char_scores = []
        for char_index, char_score in zip(output_index[2:],
                                          output_score[2:]):
            # the first num_bins indexes are for points
            if char_index in self.ignore_indexes:
                continue
            if char_index == self.dictionary.end_idx:
                break
            indexes[-1].append(char_index)
            char_scores.append(char_score)
        text_scores.append(np.mean(char_scores).item())
    return indexes, text_scores, points, pt_scores