code: def is_poly_outside_rect(poly, x, y, w, h):
      poly = np.array(poly)
      if poly[:, 0].max() < x or poly[:, 0].min() > x + w:
          return True
      if poly[:, 1].max() < y or poly[:, 1].min() > y + h:
          return True
      return False
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import cv2
  import random
label_desc: Use image node_id 2 for calling a global function with example usage: is_poly_outside_rect(poly, x, y, w, h) and returns: False, True, True