class_docstr: Randomly crops an image.
  
  Attr:
    aspect_ratio_range: An optional tuple of `floats`. The cropped area of the
      image must have an aspect `ratio = width / height` within this range.
    area_range: An optional tuple of `floats`. The cropped area of the image
      must contain a fraction of the supplied image within this range.
    min_area_fraction: Bounding boxes will be removed if their area is less than
      min_area_fraction after cropping.
class_docstr_tok: ["Randomly","crops","an","image",".","Attr",":","aspect_ratio_range",":","An","optional","tuple","of","`","floats","`",".","The","cropped","area","of","the","image","must","have","an","aspect","`","ratio","=","width","\/","height","`","within","this","range",".","area_range",":","An","optional","tuple","of","`","floats","`",".","The","cropped","area","of","the","image","must","contain","a","fraction","of","the","supplied","image","within","this","range",".","min_area_fraction",":","Bounding","boxes","will","be","removed","if","their","area","is","less","than","min_area_fraction","after","cropping","."]
docstr: Randomly samples a crop region (bounding box).
docstr_tok: ["Randomly","samples","a","crop","region","(","bounding","box",")","."]
code: def _sample_random_crop_region(
      self,
      *,
      image_shape: tf.TensorShape,
      seed: tf.Tensor,
  ) -> Tuple[tf.Tensor, tf.Tensor]:
      """Randomly samples a crop region (bounding box)."""
      return tf.image.stateless_sample_distorted_bounding_box(
          image_shape,
          tf.zeros([0, 0, 4], tf.float32),
          seed=seed,
          area_range=self.area_range,
          aspect_ratio_range=self.aspect_ratio_range,
          min_object_covered=0,  # Don't enforce a minimum area.
          use_image_if_no_bounding_boxes=True,
      )[:2]
  
imports: import abc
  import dataclasses
  from typing import Optional, Sequence, Tuple, Union
  from clu import preprocess_spec
  from scenic.projects.owl_vit.preprocessing import modalities
  from scenic.projects.owl_vit.preprocessing import transforms
  import tensorflow
label_desc: Use image node_id 1 for calling the RandomCrop obj's underlying member method code with example usage: obj._sample_random_crop_region() and returns: tf