code: def _compute_grid_proposals(
      img_w, img_h, min_wh, max_wh, aspect_ratios
  ):
      rects = []
      cell_w = max_wh
      while cell_w >= min_wh:
          step = cell_w / 2.0
          for aspect_ratio in aspect_ratios:
              w_start = 0
              while w_start < img_w:
                  h_start = 0
                  while h_start < img_h:
                      if aspect_ratio < 1:
                          w_end = w_start + cell_w
                          h_end = h_start + cell_w / aspect_ratio
                      else:
                          w_end = w_start + cell_w * aspect_ratio
                          h_end = h_start + cell_w
                      if w_end < img_w - 1 and h_end < img_h - 1:
                          rects.append(
                              [
                                  int(w_start),
                                  int(h_start),
                                  int(w_end),
                                  int(h_end),
                              ]
                          )
                      h_start += step
                  w_start += step
          cell_w = cell_w / 2
  
      return 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 6 for calling a global function with example usage: _compute_grid_proposals(img_w, img_h, min_wh, max_wh, aspect_ratios) and returns: rects