code: def __init__(
      self,
      cat_outputs=True,
      pyramid_channels=256,
      pyramid_depth=4,
      width=18,
      ocr=64,
      small=True,
      lr_mult=0.1,
  ):
      super(HRNetBB, self).__init__()
      self.cat_outputs = cat_outputs
      self.ocr_on = ocr > 0 and cat_outputs
      self.pyramid_on = pyramid_channels > 0 and cat_outputs
  
      self.hrnet = HighResolutionNet(
          width, 2, ocr_width=ocr, small=small
      )
      self.hrnet.apply(LRMult(lr_mult))
      if self.ocr_on:
          self.hrnet.ocr_distri_head.apply(LRMult(1.0))
          self.hrnet.ocr_gather_head.apply(LRMult(1.0))
          self.hrnet.conv3x3_ocr.apply(LRMult(1.0))
  
      hrnet_cat_channels = [width * 2**i for i in range(4)]
      if self.pyramid_on:
          self.output_channels = [pyramid_channels] * 4
      elif self.ocr_on:
          self.output_channels = [ocr * 2]
      elif self.cat_outputs:
          self.output_channels = [sum(hrnet_cat_channels)]
      else:
          self.output_channels = hrnet_cat_channels
  
      if self.pyramid_on:
          downsize_in_channels = (
              ocr * 2 if self.ocr_on else sum(hrnet_cat_channels)
          )
          self.downsize = MaxPoolDownSize(
              downsize_in_channels,
              pyramid_channels,
              pyramid_channels,
              pyramid_depth,
          )
  
file_path: carefree-learn/cflearn/api/cv/third_party/iharm/model/backboned/hrnet.py
imports: import torch.nn
  from .ih_model import IHModelWithBackbone
  from ..modifiers import LRMult
  from ..modeling.hrnet_ocr import HighResolutionNet
  from ..modeling.basic_blocks import MaxPoolDownSize
label_desc: Use image node_id 1 to create a new HRNetBB object from inherited base classes: nn with example: obj = HRNetBB(cat_outputs, pyramid_channels, pyramid_depth, width, ocr, small, lr_mult)