class_docstr: Anchor-free head (FCOS, Fovea, RepPoints, etc.).
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      feat_channels (int): Number of hidden channels. Used in child classes.
      stacked_convs (int): Number of stacking convs of the head.
      strides (tuple): Downsample factor of each feature map.
      dcn_on_last_conv (bool): If true, use dcn in the last layer of
          towers. Default: False.
      conv_bias (bool | 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. Default: "auto".
      loss_cls (dict): Config of classification loss.
      loss_bbox (dict): Config of localization loss.
      conv_cfg (dict): Config dict for convolution layer. Default: None.
      norm_cfg (dict): Config dict for normalization layer. Default: None.
      train_cfg (dict): Training config of anchor head.
      test_cfg (dict): Testing config of anchor head.
class_docstr_tok: ["Anchor-free","head","(","FCOS",",","Fovea",",","RepPoints",",","etc.",")",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","feat_channels","(","int",")",":","Number","of","hidden","channels",".","Used","in","child","classes",".","stacked_convs","(","int",")",":","Number","of","stacking","convs","of","the","head",".","strides","(","tuple",")",":","Downsample","factor","of","each","feature","map",".","dcn_on_last_conv","(","bool",")",":","If","true",",","use","dcn","in","the","last","layer","of","towers",".","Default",":","False",".","conv_bias","(","bool","|","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",".","Default",":","``","auto","''",".","loss_cls","(","dict",")",":","Config","of","classification","loss",".","loss_bbox","(","dict",")",":","Config","of","localization","loss",".","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Default",":","None",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","None",".","train_cfg","(","dict",")",":","Training","config","of","anchor","head",".","test_cfg","(","dict",")",":","Testing","config","of","anchor","head","."]
code: def __init__(
      self,
      num_classes,
      in_channels,
      feat_channels=256,
      stacked_convs=4,
      strides=(4, 8, 16, 32, 64),
      dcn_on_last_conv=False,
      conv_bias="auto",
      loss_cls=dict(
          type="FocalLoss",
          use_sigmoid=True,
          gamma=2.0,
          alpha=0.25,
          loss_weight=1.0,
      ),
      loss_bbox=dict(type="IoULoss", loss_weight=1.0),
      conv_cfg=None,
      norm_cfg=None,
      train_cfg=None,
      test_cfg=None,
  ):
      super(AnchorFreeHead, self).__init__()
      self.num_classes = num_classes
      self.cls_out_channels = num_classes
      self.in_channels = in_channels
      self.feat_channels = feat_channels
      self.stacked_convs = stacked_convs
      self.strides = strides
      self.dcn_on_last_conv = dcn_on_last_conv
      assert conv_bias == "auto" or isinstance(conv_bias, bool)
      self.conv_bias = conv_bias
      self.loss_cls = build_loss(loss_cls)
      self.loss_bbox = build_loss(loss_bbox)
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
      self.conv_cfg = conv_cfg
      self.norm_cfg = norm_cfg
      self.fp16_enabled = False
  
      self._init_layers()
  
imports: from abc import abstractmethod
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
  from mmcv.runner import force_fp32
  from mmdet.core import multi_apply
  from ..builder import HEADS, build_loss
  from .base_dense_head import BaseDenseHead
  from .dense_test_mixins import BBoxTestMixin
label_desc: Use image node_id 1 to create a new AnchorFreeHead object from inherited base classes: BaseDenseHead, BBoxTestMixin with example: obj = AnchorFreeHead(num_classes, in_channels, feat_channels, stacked_convs, strides, dcn_on_last_conv, conv_bias, loss_cls, loss_bbox, conv_cfg, norm_cfg, train_cfg, test_cfg)