docstr: Compute matching based on ATSS https://arxiv.org/abs/1912.02424
  `Bridging the Gap Between Anchor-based and Anchor-free Detection
  via Adaptive Training Sample Selection`
  
  Args:
      num_candidates: number of positions to select candidates from.
          Smaller value will result in a higher matcher threshold and less matched candidates.
      similarity_fn: function for similarity computation between boxes and anchors
      center_in_gt: If False (default), matched anchor center points do not need
          to lie withing the ground truth box. Recommend False for small objects.
          If True, will result in a strict matcher and less matched candidates.
      debug: if True, will print the matcher threshold in order to
          tune ``num_candidates`` and ``center_in_gt``.
docstr_tok: ["Compute","matching","based","on","ATSS","https",":","\/\/arxiv.org\/abs\/1912.02424","`","Bridging","the","Gap","Between","Anchor-based","and","Anchor-free","Detection","via","Adaptive","Training","Sample","Selection","`","Args",":","num_candidates",":","number","of","positions","to","select","candidates","from",".","Smaller","value","will","result","in","a","higher","matcher","threshold","and","less","matched","candidates",".","similarity_fn",":","function","for","similarity","computation","between","boxes","and","anchors","center_in_gt",":","If","False","(","default",")",",","matched","anchor","center","points","do","not","need","to","lie","withing","the","ground","truth","box",".","Recommend","False","for","small","objects",".","If","True",",","will","result","in","a","strict","matcher","and","less","matched","candidates",".","debug",":","if","True",",","will","print","the","matcher","threshold","in","order","to","tune","``","num_candidates","``","and","``","center_in_gt","``","."]
code: def __init__(
      self,
      num_candidates: int = 4,
      similarity_fn: Callable[[Tensor, Tensor], Tensor] = box_iou,  # type: ignore
      center_in_gt: bool = True,
      debug: bool = False,
  ):
      """
      Compute matching based on ATSS https://arxiv.org/abs/1912.02424
      `Bridging the Gap Between Anchor-based and Anchor-free Detection
      via Adaptive Training Sample Selection`
  
      Args:
          num_candidates: number of positions to select candidates from.
              Smaller value will result in a higher matcher threshold and less matched candidates.
          similarity_fn: function for similarity computation between boxes and anchors
          center_in_gt: If False (default), matched anchor center points do not need
              to lie withing the ground truth box. Recommend False for small objects.
              If True, will result in a strict matcher and less matched candidates.
          debug: if True, will print the matcher threshold in order to
              tune ``num_candidates`` and ``center_in_gt``.
      """
      super().__init__(similarity_fn=similarity_fn)
      self.num_candidates = num_candidates
      self.min_dist = 0.01
      self.center_in_gt = center_in_gt
      self.debug = debug
      logging.info(
          f"Running ATSS Matching with num_candidates={self.num_candidates} and center_in_gt {self.center_in_gt}."
      )
  
file_path: MONAI/monai/apps/detection/utils/ATSS_matcher.py
imports: from __future__ import annotations
  import logging
  from abc import ABC, abstractmethod
  from collections.abc import Callable, Sequence
  from typing import TypeVar
  import torch
  from torch import Tensor
  from monai.data.box_utils import COMPUTE_DTYPE, box_iou, boxes_center_distance, centers_in_boxes
  from monai.utils.type_conversion import convert_to_tensor
label_desc: Use image node_id 1 to create a new ATSSMatcher object from inherited base classes: Matcher with example: obj = ATSSMatcher(num_candidates, similarity_fn, center_in_gt, debug)