class_docstr: This generate anchors.
  
  Parameters
  ----------
  stride : int
      Anchor stride
  ratios : tuple
      Anchor ratios
  scales : tuple
      Anchor scales
  size : int
      anchor size
class_docstr_tok: ["This","generate","anchors",".","Parameters","--","--","--","--","--","stride",":","int","Anchor","stride","ratios",":","tuple","Anchor","ratios","scales",":","tuple","Anchor","scales","size",":","int","anchor","size"]
docstr: generate anchors based on predefined configuration
docstr_tok: ["generate","anchors","based","on","predefined","configuration"]
code: def generate_anchors(self):
      """generate anchors based on predefined configuration"""
      self.anchors = np.zeros((self.anchor_num, 4), dtype=np.float32)
      size = self.stride * self.stride
      count = 0
      for r in self.ratios:
          ws = int(math.sqrt(size * 1.0 / r))
          hs = int(ws * r)
  
          for s in self.scales:
              w = ws * s
              h = hs * s
              self.anchors[count][:] = [
                  -w * 0.5,
                  -h * 0.5,
                  w * 0.5,
                  h * 0.5,
              ][:]
              count += 1
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import math
  from collections import namedtuple
  import numpy
  import mxnet
  from mxnet import nd
  from gluoncv.utils.filesystem import try_import_cv2
label_desc: Use image node_id 2 for calling the Anchors obj's underlying member method code with example usage: obj.generate_anchors() without return types