code: def coco_anchors():
      anchors = []
  
      fig_size = 300
      feat_sizes = [38, 19, 10, 5, 3, 1]
      feat_count = len(feat_sizes)
      steps = [8.0, 16.0, 32.0, 64.0, 100.0, 300.0]
      scales = [21.0, 45.0, 99.0, 153.0, 207.0, 261.0, 315.0]
      aspect_ratios = [[2], [2, 3], [2, 3], [2, 3], [2], [2]]
  
      fks = []
      for step in steps:
          fks.append(fig_size / step)
  
      anchor_idx = 0
      for idx in range(feat_count):
          sk1 = scales[idx] / fig_size
          sk2 = scales[idx + 1] / fig_size
          sk3 = sqrt(sk1 * sk2)
  
          all_sizes = [[sk1, sk1], [sk3, sk3]]
  
          for alpha in aspect_ratios[idx]:
              w = sk1 * sqrt(alpha)
              h = sk1 / sqrt(alpha)
              all_sizes.append([w, h])
              all_sizes.append([h, w])
  
          for sizes in all_sizes:
              w = sizes[0]
              h = sizes[1]
  
              for i in range(feat_sizes[idx]):
                  for j in range(feat_sizes[idx]):
                      cx = (j + 0.5) / fks[idx]
                      cy = (i + 0.5) / fks[idx]
  
                      cx = max(min(cx, 1.0), 0.0)
                      cy = max(min(cy, 1.0), 0.0)
                      w = max(min(w, 1.0), 0.0)
                      h = max(min(h, 1.0), 0.0)
  
                      anchors.append(cx - 0.5 * w)
                      anchors.append(cy - 0.5 * h)
                      anchors.append(cx + 0.5 * w)
                      anchors.append(cy + 0.5 * h)
  
                      anchor_idx = anchor_idx + 1
      return anchors
  
imports: import argparse
  import os
  from math import ceil, sqrt
  import numpy
  import nvidia.dali.ops
  import nvidia.dali.types
  from nvidia.dali.pipeline import Pipeline
  from test_utils import get_dali_extra_path
  from test_utils import to_array
label_desc: Use image node_id 1 for calling a global function with example usage: coco_anchors() and returns: anchors