code: def generate_anchors_fpn(dense_anchor=False, cfg=None):
      # assert(False)
      """
      Generate anchor (reference) windows by enumerating aspect ratios X
      scales wrt a reference (0, 0, 15, 15) window.
      """
      if cfg is None:
          from ..config import config
  
          cfg = config.RPN_ANCHOR_CFG
      RPN_FEAT_STRIDE = []
      for k in cfg:
          RPN_FEAT_STRIDE.append(int(k))
      RPN_FEAT_STRIDE = sorted(RPN_FEAT_STRIDE, reverse=True)
      anchors = []
      for k in RPN_FEAT_STRIDE:
          v = cfg[str(k)]
          bs = v["BASE_SIZE"]
          __ratios = np.array(v["RATIOS"])
          __scales = np.array(v["SCALES"])
          stride = int(k)
          # print('anchors_fpn', bs, __ratios, __scales, file=sys.stderr)
          r = generate_anchors(
              bs, __ratios, __scales, stride, dense_anchor
          )
          # print('anchors_fpn', r.shape, file=sys.stderr)
          anchors.append(r)
  
      return anchors
  
file_path: insightface/detection/retinaface_anticov/rcnn/processing/generate_anchor.py
imports: from __future__ import print_function
  import sys
  from builtins import range
  import numpy
  from ..cython.anchors import anchors_cython
label_desc: Use image node_id 3 for calling a global function with example usage: generate_anchors_fpn(dense_anchor, cfg) and returns: anchors