class_docstr: This class assigns labels to anchors via `SSD matching process <https://arxiv.org/abs/1512.02325>`_
  
  Args:
      opts: command line arguments
      bg_class_id: Background class index
  
  Shape:
      - Input:
          - gt_boxes: Ground-truth boxes in corner form (xyxy format). Shape is :math:`(N, 4)` where :math:`N` is the number of boxes
          - gt_labels: Ground-truth box labels. Shape is :math:`(N)`
          - anchors: Anchor boxes in center form (c_x, c_y, w, h). Shape is :math:`(M, 4)` where :math:`M` is the number of anchors
  
      - Output:
          - matched_boxes of shape :math:`(M, 4)`
          - matched_box_labels of shape :math:`(M)`
class_docstr_tok: ["This","class","assigns","labels","to","anchors","via","`","SSD","matching","process","<","https",":","\/\/arxiv.org\/abs\/1512.02325",">","`","_","Args",":","opts",":","command","line","arguments","bg_class_id",":","Background","class","index","Shape",":","-","Input",":","-","gt_boxes",":","Ground-truth","boxes","in","corner","form","(","xyxy","format",")",".","Shape","is",":","math",":","`","(","N",",","4",")","`","where",":","math",":","`","N","`","is","the","number","of","boxes","-","gt_labels",":","Ground-truth","box","labels",".","Shape","is",":","math",":","`","(","N",")","`","-","anchors",":","Anchor","boxes","in","center","form","(","c_x",",","c_y",",","w",",","h",")",".","Shape","is",":","math",":","`","(","M",",","4",")","`","where",":","math",":","`","M","`","is","the","number","of","anchors","-","Output",":","-","matched_boxes","of","shape",":","math",":","`","(","M",",","4",")","`","-","matched_box_labels","of","shape",":","math",":","`","(","M",")","`"]
code: def __call__(
      self,
      gt_boxes: Union[np.ndarray, Tensor],
      gt_labels: Union[np.ndarray, Tensor],
      anchors: Tensor,
  ) -> Tuple[Tensor, Tensor]:
      if isinstance(gt_boxes, np.ndarray):
          gt_boxes = torch.from_numpy(gt_boxes)
      if isinstance(gt_labels, np.ndarray):
          gt_labels = torch.from_numpy(gt_labels)
  
      # convert box priors from center [c_x, c_y] to corner_form [x, y]
      anchors_xyxy = center_form_to_corner_form(boxes=anchors)
  
      matched_boxes_xyxy, matched_labels = assign_priors(
          gt_boxes,  # gt_boxes are in corner form [x, y, w, h]
          gt_labels,
          anchors_xyxy,  # priors are in corner form [x, y, w, h]
          self.iou_threshold,
          background_id=self.bg_class_id,
      )
  
      # convert the matched boxes to center form [c_x, c_y]
      matched_boxes_cxcywh = corner_form_to_center_form(
          matched_boxes_xyxy
      )
  
      # Eq.(2) in paper https://arxiv.org/pdf/1512.02325.pdf
      boxes_for_regression = convert_boxes_to_locations(
          gt_boxes=matched_boxes_cxcywh,  # center form
          prior_boxes=anchors,  # center form
          center_variance=self.center_variance,
          size_variance=self.size_variance,
      )
  
      return boxes_for_regression, matched_labels
  
file_path: ml-cvnets/cvnets/matcher_det/ssd_matcher.py
imports: import argparse
  from typing import Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from cvnets.matcher_det import MATCHER_REGISTRY, BaseMatcher
  from cvnets.misc.box_utils import center_form_to_corner_form, convert_boxes_to_locations, convert_locations_to_boxes, corner_form_to_center_form
  from cvnets.misc.third_party.ssd_utils import assign_priors
  from utils import logger
label_desc: Use image node_id 4 for calling the SSDMatcher obj's underlying member method code with example usage: obj.__call__(gt_boxes, gt_labels, anchors) and returns: boxes_for_regression,  matched_labels