code: def __init__(
      self,
      image_loss_weight: float = 0.1,
      use_fed_loss: bool = False,
      cat_freq_path: str = "",
      fed_loss_freq_weight: float = 0.5,
      fed_loss_num_cat: int = 50,
      cls_predictor_cfg: ConfigType = dict(type="ZeroShotClassifier"),
      *args,
      **kwargs,
  ) -> None:
      super().__init__(*args, **kwargs)
      # reconstruct fc_cls and fc_reg since input channels are changed
      assert self.with_cls
  
      self.cls_predictor_cfg = cls_predictor_cfg
      cls_channels = self.num_classes
      self.cls_predictor_cfg.update(
          in_features=self.cls_last_dim, out_features=cls_channels
      )
      self.fc_cls = MODELS.build(self.cls_predictor_cfg)
  
      self.init_cfg += [
          dict(type="Caffe2Xavier", override=dict(name="reg_fcs"))
      ]
  
      self.image_loss_weight = image_loss_weight
      self.use_fed_loss = use_fed_loss
      self.cat_freq_path = cat_freq_path
      self.fed_loss_freq_weight = fed_loss_freq_weight
      self.fed_loss_num_cat = fed_loss_num_cat
  
      if self.use_fed_loss:
          freq_weight = load_class_freq(
              cat_freq_path, fed_loss_freq_weight
          )
          self.register_buffer("freq_weight", freq_weight)
      else:
          self.freq_weight = None
  
imports: import json
  from typing import List, Optional
  import torch
  from mmengine.config import ConfigDict
  from mmengine.structures import InstanceData
  from torch import Tensor
  from torch.nn import functional
  from mmdet.models.layers import multiclass_nms
  from mmdet.models.losses import accuracy
  from mmdet.models.roi_heads.bbox_heads import Shared2FCBBoxHead
  from mmdet.models.utils import empty_instances
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import get_box_tensor, scale_boxes
  from mmdet.utils import ConfigType, InstanceList
label_desc: Use image node_id 1 to create a new DeticBBoxHead object from inherited base classes: Shared2FCBBoxHead with example: obj = DeticBBoxHead(image_loss_weight, use_fed_loss, cat_freq_path, fed_loss_freq_weight, fed_loss_num_cat, cls_predictor_cfg)