docstr: Resize or pad images to be square shape.
  
  Args:
      target_size (int): The target size of square shaped image.
      pad_with_fixed_color (bool): The flag for whether to pad rotated
         image with fixed value. If set to False, the rescales image will
         be padded onto cropped image.
      pad_value (tuple(int)): The color value for padding rotated image.
docstr_tok: ["Resize","or","pad","images","to","be","square","shape",".","Args",":","target_size","(","int",")",":","The","target","size","of","square","shaped","image",".","pad_with_fixed_color","(","bool",")",":","The","flag","for","whether","to","pad","rotated","image","with","fixed","value",".","If","set","to","False",",","the","rescales","image","will","be","padded","onto","cropped","image",".","pad_value","(","tuple","(","int",")",")",":","The","color","value","for","padding","rotated","image","."]
code: def __init__(
      self,
      target_size,
      pad_ratio=0.6,
      pad_with_fixed_color=False,
      pad_value=(0, 0, 0),
      **kwargs,
  ):
      """Resize or pad images to be square shape.
  
      Args:
          target_size (int): The target size of square shaped image.
          pad_with_fixed_color (bool): The flag for whether to pad rotated
             image with fixed value. If set to False, the rescales image will
             be padded onto cropped image.
          pad_value (tuple(int)): The color value for padding rotated image.
      """
      assert isinstance(target_size, int)
      assert isinstance(pad_ratio, float)
      assert isinstance(pad_with_fixed_color, bool)
      assert isinstance(pad_value, tuple)
  
      self.target_size = target_size
      self.pad_ratio = pad_ratio
      self.pad_with_fixed_color = pad_with_fixed_color
      self.pad_value = pad_value
  
imports: import numpy
  from PIL import Image, ImageDraw
  import cv2
  from shapely.geometry import Polygon
  import math
  from ppocr.utils.poly_nms import poly_intersection
label_desc: Use image node_id 1 to create a new SquareResizePad object  with example: obj = SquareResizePad(target_size, pad_ratio, pad_with_fixed_color, pad_value)