class_docstr: The Object contextual representation head.
  Args:
      num_classes(int): The unique number of target classes.
      in_channels(tuple): The number of input channels.
      ocr_mid_channels(int, optional): The number of middle channels in OCRHead. Default: 512.
      ocr_key_channels(int, optional): The number of key channels in ObjectAttentionBlock. Default: 256.
code: def __init__(
      self,
      num_classes: int,
      in_channels: int,
      ocr_mid_channels: int = 512,
      ocr_key_channels: int = 256,
  ):
      super().__init__()
  
      self.num_classes = num_classes
      self.spatial_gather = SpatialGatherBlock()
      self.spatial_ocr = SpatialOCRModule(
          ocr_mid_channels, ocr_key_channels, ocr_mid_channels
      )
  
      self.indices = [-2, -1] if len(in_channels) > 1 else [-1, -1]
  
      self.conv3x3_ocr = L.ConvBNReLU(
          in_channels[self.indices[1]], ocr_mid_channels, 3, padding=1
      )
      self.cls_head = nn.Conv2D(ocr_mid_channels, self.num_classes, 1)
      self.aux_head = nn.Sequential(
          L.ConvBNReLU(
              in_channels[self.indices[0]],
              in_channels[self.indices[0]],
              1,
          ),
          nn.Conv2D(in_channels[self.indices[0]], self.num_classes, 1),
      )
  
imports: import os
  from typing import List
  import paddle
  import numpy
  import paddle.nn
  import paddle.nn.functional
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  import ocrnet_hrnetw18_cityscapes.layers
  from ocrnet_hrnetw18_cityscapes.hrnet import HRNet_W18
label_desc: Use image node_id 1 to create a new OCRHead object from inherited base classes: nn with example: obj = OCRHead(num_classes, in_channels, ocr_mid_channels, ocr_key_channels)