class_docstr: Legacy anchor generator used in MMDetection V1.x.
  
  The difference between `LegacySSDAnchorGenerator` and `SSDAnchorGenerator`
  can be found in `LegacyAnchorGenerator`.
class_docstr_tok: ["Legacy","anchor","generator","used","in","MMDetection","V1.x",".","The","difference","between","`","LegacySSDAnchorGenerator","`","and","`","SSDAnchorGenerator","`","can","be","found","in","`","LegacyAnchorGenerator","`","."]
code: def __init__(
      self,
      strides: Union[List[int], List[Tuple[int, int]]],
      ratios: List[float],
      basesize_ratio_range: Tuple[float],
      input_size: int = 300,
      scale_major: bool = True,
      use_box_type: bool = False,
  ) -> None:
      super(LegacySSDAnchorGenerator, self).__init__(
          strides=strides,
          ratios=ratios,
          basesize_ratio_range=basesize_ratio_range,
          input_size=input_size,
          scale_major=scale_major,
          use_box_type=use_box_type,
      )
      self.centers = [
          ((stride - 1) / 2.0, (stride - 1) / 2.0) for stride in strides
      ]
      self.base_anchors = self.gen_base_anchors()
  
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 LegacySSDAnchorGenerator object from inherited base classes: SSDAnchorGenerator, LegacyAnchorGenerator with example: obj = LegacySSDAnchorGenerator(strides, ratios, basesize_ratio_range, input_size, scale_major, use_box_type)