class_docstr: Making binary mask from detection data with ICDAR format.
  Typically following the process of class `MakeICDARData`.
docstr: polygons (numpy.array, required): of shape (num_instances, num_points, 2)
docstr_tok: ["polygons","(","numpy.array",",","required",")",":","of","shape","(","num_instances",",","num_points",",","2",")"]
code: def validate_polygons(self, polygons, ignore_tags, h, w):
      """
      polygons (numpy.array, required): of shape (num_instances, num_points, 2)
      """
      if len(polygons) == 0:
          return polygons, ignore_tags
      assert len(polygons) == len(ignore_tags)
      for polygon in polygons:
          polygon[:, 0] = np.clip(polygon[:, 0], 0, w - 1)
          polygon[:, 1] = np.clip(polygon[:, 1], 0, h - 1)
  
      for i in range(len(polygons)):
          area = self.polygon_area(polygons[i])
          if abs(area) < 1:
              ignore_tags[i] = True
          if area > 0:
              polygons[i] = polygons[i][::-1, :]
      return polygons, ignore_tags
  
file_path: PaddleOCR/ppocr/data/imaug/make_shrink_map.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import cv2
  from shapely.geometry import Polygon
  import pyclipper
label_desc: Use image node_id 3 for calling the MakeShrinkMap obj's underlying member method code with example usage: obj.validate_polygons(polygons, ignore_tags, h, w) and returns: polygons,  ignore_tags, polygons,  ignore_tags