docstr: Generate the gt targets for DRRG.
  
  Args:
      data (dict): The input result dictionary.
  
  Returns:
      data (dict): The output result dictionary.
docstr_tok: ["Generate","the","gt","targets","for","DRRG",".","Args",":","data","(","dict",")",":","The","input","result","dictionary",".","Returns",":","data","(","dict",")",":","The","output","result","dictionary","."]
code: def generate_targets(self, data):
      """Generate the gt targets for DRRG.
  
      Args:
          data (dict): The input result dictionary.
  
      Returns:
          data (dict): The output result dictionary.
      """
  
      assert isinstance(data, dict)
  
      image = data["image"]
      polygons = data["polys"]
      ignore_tags = data["ignore_tags"]
      h, w, _ = image.shape
  
      polygon_masks = []
      polygon_masks_ignore = []
      for tag, polygon in zip(ignore_tags, polygons):
          if tag is True:
              polygon_masks_ignore.append(polygon)
          else:
              polygon_masks.append(polygon)
  
      gt_text_mask = self.generate_text_region_mask(
          (h, w), polygon_masks
      )
      gt_mask = self.generate_effective_mask(
          (h, w), polygon_masks_ignore
      )
      (
          center_lines,
          gt_center_region_mask,
          gt_top_height_map,
          gt_bot_height_map,
          gt_sin_map,
          gt_cos_map,
      ) = self.generate_center_mask_attrib_maps((h, w), polygon_masks)
  
      gt_comp_attribs = self.generate_comp_attribs(
          center_lines,
          gt_text_mask,
          gt_center_region_mask,
          gt_top_height_map,
          gt_bot_height_map,
          gt_sin_map,
          gt_cos_map,
      )
  
      mapping = {
          "gt_text_mask": gt_text_mask,
          "gt_center_region_mask": gt_center_region_mask,
          "gt_mask": gt_mask,
          "gt_top_height_map": gt_top_height_map,
          "gt_bot_height_map": gt_bot_height_map,
          "gt_sin_map": gt_sin_map,
          "gt_cos_map": gt_cos_map,
      }
  
      data.update(mapping)
      data["gt_comp_attribs"] = gt_comp_attribs
      return data
  
imports: import cv2
  import numpy
  from ppocr.utils.utility import check_install
  from numpy.linalg import norm
label_desc: Use image node_id 19 for calling the DRRGTargets obj's underlying member method code with example usage: obj.generate_targets(data) and returns: data