class_docstr: Random cropping with constraints
  
  Parameters
  ----------
  min_object_covered : float, default=0.1
      The cropped area of the image must contain at least this fraction of
      any bounding box supplied. The value of this parameter should be non-negative.
      In the case of 0, the cropped area does not need to overlap any of the
      bounding boxes supplied.
  min_eject_coverage : float, default=0.3
      The minimum coverage of cropped sample w.r.t its original size. With this
      constraint, objects that have marginal area after crop will be discarded.
  aspect_ratio_range : tuple of floats, default=(0.75, 1.33)
      The cropped area of the image must have an aspect ratio = width / height
      within this range.
  area_range : tuple of floats, default=(0.05, 1.0)
      The cropped area of the image must contain a fraction of the supplied
      image within in this range.
  max_attempts : int, default=50
      Number of attempts at generating a cropped/padded region of the image of the
      specified constraints. After max_attempts failures, return the original image.
class_docstr_tok: ["Random","cropping","with","constraints","Parameters","--","--","--","--","--","min_object_covered",":","float",",","default=0.1","The","cropped","area","of","the","image","must","contain","at","least","this","fraction","of","any","bounding","box","supplied",".","The","value","of","this","parameter","should","be","non-negative",".","In","the","case","of","0",",","the","cropped","area","does","not","need","to","overlap","any","of","the","bounding","boxes","supplied",".","min_eject_coverage",":","float",",","default=0.3","The","minimum","coverage","of","cropped","sample","w.r.t","its","original","size",".","With","this","constraint",",","objects","that","have","marginal","area","after","crop","will","be","discarded",".","aspect_ratio_range",":","tuple","of","floats",",","default=","(","0.75",",","1.33",")","The","cropped","area","of","the","image","must","have","an","aspect","ratio","=","width","\/","height","within","this","range",".","area_range",":","tuple","of","floats",",","default=","(","0.05",",","1.0",")","The","cropped","area","of","the","image","must","contain","a","fraction","of","the","supplied","image","within","in","this","range",".","max_attempts",":","int",",","default=50","Number","of","attempts","at","generating","a","cropped\/padded","region","of","the","image","of","the","specified","constraints",".","After","max_attempts","failures",",","return","the","original","image","."]
docstr: Calculate intersect areas, normalized.
docstr_tok: ["Calculate","intersect","areas",",","normalized","."]
code: def _intersect(self, label, xmin, ymin, xmax, ymax):
      """Calculate intersect areas, normalized."""
      left = np.maximum(label[:, 0], xmin)
      right = np.minimum(label[:, 2], xmax)
      top = np.maximum(label[:, 1], ymin)
      bot = np.minimum(label[:, 3], ymax)
      invalid = np.where(np.logical_or(left >= right, top >= bot))[0]
      out = label.copy()
      out[:, 0] = left
      out[:, 1] = top
      out[:, 2] = right
      out[:, 3] = bot
      out[invalid, :] = 0
      return out
  
imports: import json
  import logging
  import random
  import warnings
  import numpy
  from ..base import numeric_types
  from ..None import ndarray
  from ..ndarray._internal import _cvcopyMakeBorder
  from ..None import io
  from .image import RandomOrderAug, ColorJitterAug, LightingAug, ColorNormalizeAug
  from .image import ResizeAug, ForceResizeAug, CastAug, HueJitterAug, RandomGrayAug
  from .image import fixed_crop, ImageIter, Augmenter
  from ..util import is_np_array
  from ..None import numpy
label_desc: Use image node_id 4 for calling the DetRandomCropAug obj's underlying member method code with example usage: obj._intersect(label, xmin, ymin, xmax, ymax) and returns: out