class_docstr: Random crop the input image according to constraints.
  
  Args:
      scales(list): The value of the cutting area relative to the original area, expressed in the form of                       [min, max]. The default value is [.3, 1.].
      max_ratio(float): Max ratio of the original area relative to the cutting area, default is 2.0.
      constraints(list): The value of min and max iou values, default is None.
      max_trial(int): The max trial for finding a valid crop area. The default value is 50.
  
  Returns:
      img(np.ndarray): Distorted image.
      data(dict): Image info and label info.
class_docstr_tok: ["Random","crop","the","input","image","according","to","constraints",".","Args",":","scales","(","list",")",":","The","value","of","the","cutting","area","relative","to","the","original","area",",","expressed","in","the","form","of","[","min",",","max","]",".","The","default","value","is","[",".3",",","1.","]",".","max_ratio","(","float",")",":","Max","ratio","of","the","original","area","relative","to","the","cutting","area",",","default","is","2.0.","constraints","(","list",")",":","The","value","of","min","and","max","iou","values",",","default","is","None",".","max_trial","(","int",")",":","The","max","trial","for","finding","a","valid","crop","area",".","The","default","value","is","50",".","Returns",":","img","(","np.ndarray",")",":","Distorted","image",".","data","(","dict",")",":","Image","info","and","label","info","."]
code: def __init__(
      self,
      scales: list = [0.3, 1.0],
      max_ratio: float = 2.0,
      constraints: list = None,
      max_trial: int = 50,
  ):
      self.scales = scales
      self.max_ratio = max_ratio
      self.constraints = constraints
      self.max_trial = max_trial
  
imports: import os
  import random
  from typing import Callable
  import cv2
  import PIL
  import numpy
  import paddlehub.vision.transforms.functional
  from paddlehub.vision.utils import box_crop, box_iou_xywh
label_desc: Use image node_id 1 to create a new RandomCrop object  with example: obj = RandomCrop(scales, max_ratio, constraints, max_trial)