class_docstr: Anchor generator for YOLO.
  
  Args:
      strides (list[int] | list[tuple[int, int]]): Strides of anchors
          in multiple feature levels.
      base_sizes (list[list[tuple[int, int]]]): The basic sizes
          of anchors in multiple levels.
class_docstr_tok: ["Anchor","generator","for","YOLO",".","Args",":","strides","(","list","[","int","]","|","list","[","tuple","[","int",",","int","]","]",")",":","Strides","of","anchors","in","multiple","feature","levels",".","base_sizes","(","list","[","list","[","tuple","[","int",",","int","]","]","]",")",":","The","basic","sizes","of","anchors","in","multiple","levels","."]
code: def __init__(
      self,
      strides: Union[List[int], List[Tuple[int, int]]],
      base_sizes: List[List[Tuple[int, int]]],
      use_box_type: bool = False,
  ) -> None:
      self.strides = [_pair(stride) for stride in strides]
      self.centers = [
          (stride[0] / 2.0, stride[1] / 2.0) for stride in self.strides
      ]
      self.base_sizes = []
      num_anchor_per_level = len(base_sizes[0])
      for base_sizes_per_level in base_sizes:
          assert num_anchor_per_level == len(base_sizes_per_level)
          self.base_sizes.append(
              [_pair(base_size) for base_size in base_sizes_per_level]
          )
      self.base_anchors = self.gen_base_anchors()
      self.use_box_type = use_box_type
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import numpy
  import torch
  from mmengine.utils import is_tuple_of
  from torch import Tensor
  from torch.nn.modules.utils import _pair
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import HorizontalBoxes
label_desc: Use image node_id 1 to create a new YOLOAnchorGenerator object from inherited base classes: AnchorGenerator with example: obj = YOLOAnchorGenerator(strides, base_sizes, use_box_type)