class_docstr: Detection Head of `FoveaBox: Beyond Anchor-based Object Detector.
  
  <https://arxiv.org/abs/1904.03797>`_.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      base_edge_list (list[int]): List of edges.
      scale_ranges (list[tuple]): Range of scales.
      sigma (float): Super parameter of ``FoveaHead``.
      with_deform (bool):  Whether use deform conv.
      deform_groups (int): Deformable conv group size.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict.
class_docstr_tok: ["Detection","Head","of","`","FoveaBox",":","Beyond","Anchor-based","Object","Detector",".","<","https",":","\/\/arxiv.org\/abs\/1904.03797",">","`","_",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","base_edge_list","(","list","[","int","]",")",":","List","of","edges",".","scale_ranges","(","list","[","tuple","]",")",":","Range","of","scales",".","sigma","(","float",")",":","Super","parameter","of","``","FoveaHead","``",".","with_deform","(","bool",")",":","Whether","use","deform","conv",".","deform_groups","(","int",")",":","Deformable","conv","group","size",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","optional",")",":","Initialization","config","dict","."]
docstr: Compute regression and classification for priors in multiple images.
  
  Args:
      batch_gt_instances (list[:obj:`InstanceData`]): Batch of
          gt_instance.  It usually includes ``bboxes`` and ``labels``
          attributes.
      featmap_sizes (list[tuple]): Size tuple of feature maps.
      priors_list (list[Tensor]): Priors list of each fpn level, each has
          shape (num_priors, 2).
  
  Returns:
      tuple: Targets of each level.
  
      - flatten_labels (list[Tensor]): Labels of each level.
      - flatten_bbox_targets (list[Tensor]): BBox targets of each
        level.
docstr_tok: ["Compute","regression","and","classification","for","priors","in","multiple","images",".","Args",":","batch_gt_instances","(","list","[",":","obj",":","`","InstanceData","`","]",")",":","Batch","of","gt_instance",".","It","usually","includes","``","bboxes","``","and","``","labels","``","attributes",".","featmap_sizes","(","list","[","tuple","]",")",":","Size","tuple","of","feature","maps",".","priors_list","(","list","[","Tensor","]",")",":","Priors","list","of","each","fpn","level",",","each","has","shape","(","num_priors",",","2",")",".","Returns",":","tuple",":","Targets","of","each","level",".","-","flatten_labels","(","list","[","Tensor","]",")",":","Labels","of","each","level",".","-","flatten_bbox_targets","(","list","[","Tensor","]",")",":","BBox","targets","of","each","level","."]
code: def get_targets(
      self,
      batch_gt_instances: InstanceList,
      featmap_sizes: List[tuple],
      priors_list: List[Tensor],
  ) -> Tuple[List[Tensor], List[Tensor]]:
      """Compute regression and classification for priors in multiple images.
  
      Args:
          batch_gt_instances (list[:obj:`InstanceData`]): Batch of
              gt_instance.  It usually includes ``bboxes`` and ``labels``
              attributes.
          featmap_sizes (list[tuple]): Size tuple of feature maps.
          priors_list (list[Tensor]): Priors list of each fpn level, each has
              shape (num_priors, 2).
  
      Returns:
          tuple: Targets of each level.
  
          - flatten_labels (list[Tensor]): Labels of each level.
          - flatten_bbox_targets (list[Tensor]): BBox targets of each
            level.
      """
      label_list, bbox_target_list = multi_apply(
          self._get_targets_single,
          batch_gt_instances,
          featmap_size_list=featmap_sizes,
          priors_list=priors_list,
      )
      flatten_labels = [
          torch.cat(
              [
                  labels_level_img.flatten()
                  for labels_level_img in labels_level
              ]
          )
          for labels_level in zip(*label_list)
      ]
      flatten_bbox_targets = [
          torch.cat(
              [
                  bbox_targets_level_img.reshape(-1, 4)
                  for bbox_targets_level_img in bbox_targets_level
              ]
          )
          for bbox_targets_level in zip(*bbox_target_list)
      ]
      flatten_labels = torch.cat(flatten_labels)
      flatten_bbox_targets = torch.cat(flatten_bbox_targets)
      return flatten_labels, flatten_bbox_targets
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmcv.ops import DeformConv2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import InstanceList, OptInstanceList, OptMultiConfig
  from ..utils import filter_scores_and_topk, multi_apply
  from .anchor_free_head import AnchorFreeHead
label_desc: Use image node_id 5 for calling the FoveaHead obj's underlying member method code with example usage: obj.get_targets(batch_gt_instances, featmap_sizes, priors_list) and returns: flatten_labels,  flatten_bbox_targets