class_docstr: The class for implementing DBNet loss.
  
  This is partially adapted from https://github.com/MhLiao/DB.
  
  Args:
      loss_prob (dict): The loss config for probability map. Defaults to
          dict(type='MaskedBalancedBCEWithLogitsLoss').
      loss_thr (dict): The loss config for threshold map. Defaults to
          dict(type='MaskedSmoothL1Loss', beta=0).
      loss_db (dict): The loss config for binary map. Defaults to
          dict(type='MaskedDiceLoss').
      weight_prob (float): The weight of probability map loss.
          Denoted as :math:`\alpha` in paper. Defaults to 5.
      weight_thr (float): The weight of threshold map loss.
          Denoted as :math:`\beta` in paper. Defaults to 10.
      shrink_ratio (float): The ratio of shrunk text region. Defaults to 0.4.
      thr_min (float): The minimum threshold map value. Defaults to 0.3.
      thr_max (float): The maximum threshold map value. Defaults to 0.7.
      min_sidelength (int or float): The minimum sidelength of the
          minimum rotated rectangle around any text region. Defaults to 8.
docstr: Generate loss targets from data samples.
  
  Args:
      data_samples (list(TextDetDataSample)): Ground truth data samples.
  
  Returns:
      tuple: A tuple of four tensors as DBNet targets.
docstr_tok: ["Generate","loss","targets","from","data","samples",".","Args",":","data_samples","(","list","(","TextDetDataSample",")",")",":","Ground","truth","data","samples",".","Returns",":","tuple",":","A","tuple","of","four","tensors","as","DBNet","targets","."]
code: def get_targets(self, data_samples: List[TextDetDataSample]) -> Tuple:
      """Generate loss targets from data samples.
  
      Args:
          data_samples (list(TextDetDataSample)): Ground truth data samples.
  
      Returns:
          tuple: A tuple of four tensors as DBNet targets.
      """
  
      gt_shrinks, gt_shrink_masks, gt_thrs, gt_thr_masks = multi_apply(
          self._get_target_single, data_samples
      )
      gt_shrinks = torch.cat(gt_shrinks)
      gt_shrink_masks = torch.cat(gt_shrink_masks)
      gt_thrs = torch.cat(gt_thrs)
      gt_thr_masks = torch.cat(gt_thr_masks)
      return gt_shrinks, gt_shrink_masks, gt_thrs, gt_thr_masks
  
imports: from typing import Dict, List, Sequence, Tuple, Union
  import cv2
  import numpy
  import torch
  from mmdet.models.utils import multi_apply
  from shapely.geometry import Polygon
  from torch import Tensor
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import offset_polygon
  from mmocr.utils.typing_utils import ArrayLike
  from .seg_based_module_loss import SegBasedModuleLoss
label_desc: Use image node_id 6 for calling the DBModuleLoss obj's underlying member method code with example usage: obj.get_targets(data_samples) and returns: gt_shrinks,  gt_shrink_masks,  gt_thrs,  gt_thr_masks