code: def compute_grid_proposals(
      num_proposals,
      img_w,
      img_h,
      min_wh,
      max_wh,
      aspect_ratios=[1.0, 2.0, 0.5],
      shuffle=True,
  ):
      rects = []
      iter = 0
      while len(rects) < num_proposals:
          if iter == 0:
              new_ar = aspect_ratios
          else:
              new_ar = []
              for ar in aspect_ratios:
                  new_ar.append(ar * (0.9**iter))
                  new_ar.append(ar * (1.1**iter))
  
          new_rects = np.array(
              _compute_grid_proposals(
                  img_w, img_h, min_wh, max_wh, new_ar
              )
          )
          take = min(num_proposals - len(rects), len(new_rects))
  
          if shuffle and take < len(new_rects):
              keep_inds = range(len(new_rects))
              keep_inds = np.random.choice(
                  keep_inds, size=take, replace=False
              )
              new_rects = new_rects[keep_inds]
          else:
              new_rects = new_rects[:take]
  
          rects.extend(new_rects)
          iter = iter + 1
  
      np_rects = np.array(rects)
      assert np_rects.shape[0] == num_proposals
      return np_rects
  
imports: import os, sys
  import numpy
  import cv2
  from utils.rpn.bbox_transform import bbox_transform
  from utils.cython_modules.cython_bbox import bbox_overlaps
label_desc: Use image node_id 5 for calling a global function with example usage: compute_grid_proposals(num_proposals, img_w, img_h, min_wh, max_wh, aspect_ratios, shuffle) and returns: np_rects