class_docstr: Dataset class for the MS COCO Object Detection using Single Shot Object Detector (SSD).
  
  Args:
      opts: Command-line arguments
class_docstr_tok: ["Dataset","class","for","the","MS","COCO","Object","Detection","using","Single","Shot","Object","Detector","(","SSD",")",".","Args",":","opts",":","Command-line","arguments"]
code: def __init__(
      self,
      opts: argparse.Namespace,
      *args,
      **kwargs,
  ) -> None:
      if getattr(opts, "matcher.name") != "ssd":
          logger.error("For SSD, we need --matcher.name as ssd")
  
      anchor_gen_name = getattr(opts, "anchor_generator.name")
      if anchor_gen_name is None or anchor_gen_name != "ssd":
          logger.error(
              "For SSD, we need --anchor-generator.name to be ssd"
          )
  
      super().__init__(opts=opts, *args, **kwargs)
  
      # we build the anchor generator and matching inside the dataset
      # so that we can use it with variable batch samplers.
      self.anchor_box_generator = build_anchor_generator(
          opts=opts, is_numpy=True
      )
      self.match_prior = build_matcher(opts=opts)
  
      # output strides for generating anchors
      self.output_strides = self.anchor_box_generator.output_strides
  
      # set the collate functions for the dataset
      setattr(
          opts, "dataset.collate_fn_name_train", "coco_ssd_collate_fn"
      )
      setattr(
          opts, "dataset.collate_fn_name_val", "coco_ssd_collate_fn"
      )
      setattr(
          opts, "dataset.collate_fn_name_test", "coco_ssd_collate_fn"
      )
  
imports: import argparse
  import math
  from typing import List, Mapping, Tuple, Union
  import torch
  from torch import Tensor
  from cvnets.anchor_generator import build_anchor_generator
  from cvnets.matcher_det import build_matcher
  from data.collate_fns import COLLATE_FN_REGISTRY
  from data.datasets import DATASET_REGISTRY
  from data.datasets.detection.coco_base import COCODetection
  from data.transforms import image_pil
  from data.transforms.common import Compose
  from utils import logger
label_desc: Use image node_id 1 to create a new COCODetectionSSD object from inherited base classes: COCODetection with example: obj = COCODetectionSSD(opts)