code: def forward(self, predicts, labels):
      (
          images,
          tcl_maps,
          tcl_label_maps,
          border_maps,
          direction_maps,
          training_masks,
          label_list,
          pos_list,
          pos_mask,
      ) = labels
      # for all the batch_size
      pos_list, pos_mask, label_list, label_t = pre_process(
          label_list,
          pos_list,
          pos_mask,
          self.max_text_length,
          self.max_text_nums,
          self.pad_num,
          self.tcl_bs,
      )
  
      f_score, f_border, f_direction, f_char = (
          predicts["f_score"],
          predicts["f_border"],
          predicts["f_direction"],
          predicts["f_char"],
      )
      score_loss = self.dice_loss(f_score, tcl_maps, training_masks)
      border_loss = self.border_loss(
          f_border, border_maps, tcl_maps, training_masks
      )
      direction_loss = self.direction_loss(
          f_direction, direction_maps, tcl_maps, training_masks
      )
      ctc_loss = self.ctcloss(
          f_char, pos_list, pos_mask, label_list, label_t
      )
      loss_all = (
          score_loss + border_loss + direction_loss + 5 * ctc_loss
      )
  
      losses = {
          "loss": loss_all,
          "score_loss": score_loss,
          "border_loss": border_loss,
          "direction_loss": direction_loss,
          "ctc_loss": ctc_loss,
      }
      return losses
  
file_path: PaddleOCR/ppocr/losses/e2e_pg_loss.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from paddle import nn
  import paddle
  from .det_basic_loss import DiceLoss
  from ppocr.utils.e2e_utils.extract_batchsize import pre_process
label_desc: Use image node_id 5 for calling the PGLoss obj's underlying member method code with example usage: obj.forward(predicts, labels) and returns: losses