class_docstr: Anchor-free head used in `FCOS <https://arxiv.org/abs/1904.01355>`_.
  
  The FCOS head does not use anchor boxes. Instead bounding boxes are
  predicted at each pixel and a centerness measure is used to suppress
  low-quality predictions.
  Here norm_on_bbox, centerness_on_reg, dcn_on_last_conv are training
  tricks used in official repo, which will bring remarkable mAP gains
  of up to 4.9. Please see https://github.com/tianzhi0549/FCOS for
  more detail.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      strides (Sequence[int] or Sequence[Tuple[int, int]]): Strides of points
          in multiple feature levels. Defaults to (4, 8, 16, 32, 64).
      regress_ranges (Sequence[Tuple[int, int]]): Regress range of multiple
          level points.
      center_sampling (bool): If true, use center sampling.
          Defaults to False.
      center_sample_radius (float): Radius of center sampling.
          Defaults to 1.5.
      norm_on_bbox (bool): If true, normalize the regression targets with
          FPN strides. Defaults to False.
      centerness_on_reg (bool): If true, position centerness on the
          regress branch. Please refer to https://github.com/tianzhi0549/FCOS/issues/89#issuecomment-516877042.
          Defaults to False.
      conv_bias (bool or str): If specified as `auto`, it will be decided by
          the norm_cfg. Bias of conv will be set as True if `norm_cfg` is
          None, otherwise False. Defaults to "auto".
      loss_cls (:obj:`ConfigDict` or dict): Config of classification loss.
      loss_bbox (:obj:`ConfigDict` or dict): Config of localization loss.
      loss_centerness (:obj:`ConfigDict`, or dict): Config of centerness
          loss.
      norm_cfg (:obj:`ConfigDict` or dict): dictionary to construct and
          config norm layer.  Defaults to
          ``norm_cfg=dict(type='GN', num_groups=32, requires_grad=True)``.
      cls_predictor_cfg (:obj:`ConfigDict` or dict): dictionary to construct and
          config conv_cls. Defaults to None.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict]): Initialization config dict.
  
  Example:
      >>> self = FCOSHead(11, 7)
      >>> feats = [torch.rand(1, 7, s, s) for s in [4, 8, 16, 32, 64]]
      >>> cls_score, bbox_pred, centerness = self.forward(feats)
      >>> assert len(cls_score) == len(self.scales)
class_docstr_tok: ["Anchor-free","head","used","in","`","FCOS","<","https",":","\/\/arxiv.org\/abs\/1904.01355",">","`","_",".","The","FCOS","head","does","not","use","anchor","boxes",".","Instead","bounding","boxes","are","predicted","at","each","pixel","and","a","centerness","measure","is","used","to","suppress","low-quality","predictions",".","Here","norm_on_bbox",",","centerness_on_reg",",","dcn_on_last_conv","are","training","tricks","used","in","official","repo",",","which","will","bring","remarkable","mAP","gains","of","up","to","4.9",".","Please","see","https",":","\/\/github.com\/tianzhi0549\/FCOS","for","more","detail",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","strides","(","Sequence","[","int","]","or","Sequence","[","Tuple","[","int",",","int","]","]",")",":","Strides","of","points","in","multiple","feature","levels",".","Defaults","to","(","4",",","8",",","16",",","32",",","64",")",".","regress_ranges","(","Sequence","[","Tuple","[","int",",","int","]","]",")",":","Regress","range","of","multiple","level","points",".","center_sampling","(","bool",")",":","If","true",",","use","center","sampling",".","Defaults","to","False",".","center_sample_radius","(","float",")",":","Radius","of","center","sampling",".","Defaults","to","1.5.","norm_on_bbox","(","bool",")",":","If","true",",","normalize","the","regression","targets","with","FPN","strides",".","Defaults","to","False",".","centerness_on_reg","(","bool",")",":","If","true",",","position","centerness","on","the","regress","branch",".","Please","refer","to","https",":","\/\/github.com\/tianzhi0549\/FCOS\/issues\/89","#","issuecomment-516877042",".","Defaults","to","False",".","conv_bias","(","bool","or","str",")",":","If","specified","as","`","auto","`",",","it","will","be","decided","by","the","norm_cfg",".","Bias","of","conv","will","be","set","as","True","if","`","norm_cfg","`","is","None",",","otherwise","False",".","Defaults","to","``","auto","''",".","loss_cls","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","classification","loss",".","loss_bbox","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","localization","loss",".","loss_centerness","(",":","obj",":","`","ConfigDict","`",",","or","dict",")",":","Config","of","centerness","loss",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","dictionary","to","construct","and","config","norm","layer",".","Defaults","to","``","norm_cfg=dict","(","type='GN","'",",","num_groups=32",",","requires_grad=True",")","``",".","cls_predictor_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","dictionary","to","construct","and","config","conv_cls",".","Defaults","to","None",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",")",":","Initialization","config","dict",".","Example",":",">",">",">","self","=","FCOSHead","(","11",",","7",")",">",">",">","feats","=","[","torch.rand","(","1",",","7",",","s",",","s",")","for","s","in","[","4",",","8",",","16",",","32",",","64","]","]",">",">",">","cls_score",",","bbox_pred",",","centerness","=","self.forward","(","feats",")",">",">",">","assert","len","(","cls_score",")","==","len","(","self.scales",")"]
docstr: Forward features from the upstream network.
  
  Args:
      feats (tuple[Tensor]): Features from the upstream network, each is
          a 4D-tensor.
  
  Returns:
      tuple: A tuple of each level outputs.
  
      - cls_scores (list[Tensor]): Box scores for each scale level,             each is a 4D-tensor, the channel number is             num_points * num_classes.
      - bbox_preds (list[Tensor]): Box energies / deltas for each             scale level, each is a 4D-tensor, the channel number is             num_points * 4.
      - centernesses (list[Tensor]): centerness for each scale level,             each is a 4D-tensor, the channel number is num_points * 1.
docstr_tok: ["Forward","features","from","the","upstream","network",".","Args",":","feats","(","tuple","[","Tensor","]",")",":","Features","from","the","upstream","network",",","each","is","a","4D-tensor",".","Returns",":","tuple",":","A","tuple","of","each","level","outputs",".","-","cls_scores","(","list","[","Tensor","]",")",":","Box","scores","for","each","scale","level",",","each","is","a","4D-tensor",",","the","channel","number","is","num_points","*","num_classes",".","-","bbox_preds","(","list","[","Tensor","]",")",":","Box","energies","\/","deltas","for","each","scale","level",",","each","is","a","4D-tensor",",","the","channel","number","is","num_points","*","4",".","-","centernesses","(","list","[","Tensor","]",")",":","centerness","for","each","scale","level",",","each","is","a","4D-tensor",",","the","channel","number","is","num_points","*","1","."]
code: def forward(
      self, x: Tuple[Tensor]
  ) -> Tuple[List[Tensor], List[Tensor], List[Tensor]]:
      """Forward features from the upstream network.
  
          Args:
              feats (tuple[Tensor]): Features from the upstream network, each is
                  a 4D-tensor.
  
          Returns:
              tuple: A tuple of each level outputs.
  
              - cls_scores (list[Tensor]): Box scores for each scale level, \
              each is a 4D-tensor, the channel number is \
              num_points * num_classes.
              - bbox_preds (list[Tensor]): Box energies / deltas for each \
              scale level, each is a 4D-tensor, the channel number is \
              num_points * 4.
              - centernesses (list[Tensor]): centerness for each scale level, \
              each is a 4D-tensor, the channel number is num_points * 1.
          """
      return multi_apply(
          self.forward_single, x, self.scales, self.strides
      )
  
imports: from typing import Dict, List, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import Scale
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.layers import NormedConv2d
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptInstanceList, RangeType, reduce_mean
  from ..utils import multi_apply
  from .anchor_free_head import AnchorFreeHead
label_desc: Use image node_id 3 for calling the FCOSHead obj's underlying member method code with example usage: obj.forward(x) and returns: multi_apply