class_docstr: Base class for the task of object detection
  
  Args:
      opts: Command-line arguments
      encoder: Image-encoder model (e.g., MobileNet or ResNet)
code: def __init__(
      self,
      opts: argparse.Namespace,
      encoder: BaseImageEncoder,
      *args,
      **kwargs,
  ) -> None:
      super().__init__(opts, *args, **kwargs)
      assert isinstance(encoder, BaseImageEncoder)
      self.encoder: BaseImageEncoder = encoder
      self.n_detection_classes = getattr(
          opts, "model.detection.n_classes"
      )
  
      enc_conf = self.encoder.model_conf_dict
  
      enc_ch_l5_out_proj = check_feature_map_output_channels(
          enc_conf, "exp_before_cls"
      )
      enc_ch_l5_out = check_feature_map_output_channels(
          enc_conf, "layer5"
      )
      enc_ch_l4_out = check_feature_map_output_channels(
          enc_conf, "layer4"
      )
      enc_ch_l3_out = check_feature_map_output_channels(
          enc_conf, "layer3"
      )
      enc_ch_l2_out = check_feature_map_output_channels(
          enc_conf, "layer2"
      )
      enc_ch_l1_out = check_feature_map_output_channels(
          enc_conf, "layer1"
      )
  
      self.enc_l5_channels = enc_ch_l5_out
      self.enc_l5_channels_exp = enc_ch_l5_out_proj
      self.enc_l4_channels = enc_ch_l4_out
      self.enc_l3_channels = enc_ch_l3_out
      self.enc_l2_channels = enc_ch_l2_out
      self.enc_l1_channels = enc_ch_l1_out
  
      self.opts = opts
  
file_path: ml-cvnets/cvnets/models/detection/base_detection.py
imports: import argparse
  from typing import Dict
  from torch import nn
  from cvnets.misc.init_utils import initialize_weights
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel, get_model
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from utils import logger
label_desc: Use image node_id 1 to create a new BaseDetection object from inherited base classes: BaseAnyNNModel with example: obj = BaseDetection(opts, encoder)