class_docstr: Randomly crops an image based on self._sample_random_crop_region.
class_docstr_tok: ["Randomly","crops","an","image","based","on","self._sample_random_crop_region","."]
docstr: Randomly samples a crop region (bounding box) for random cropping.
  
  The region is represented as two tensors, `begin` and `size`, which can be
  passed directly to tf.slice to slice the sampled region from the original
  image.
  
  Args:
    image_shape: Shape of the image (height, width, channels) from which crops
      will be taken.
    seed: Random seed for tf.image.stateless_sample_distorted_bounding_box.
  
  Returns:
    Two tensors, begin and size, which can be passed directly to tf.slice.
docstr_tok: ["Randomly","samples","a","crop","region","(","bounding","box",")","for","random","cropping",".","The","region","is","represented","as","two","tensors",",","`","begin","`","and","`","size","`",",","which","can","be","passed","directly","to","tf.slice","to","slice","the","sampled","region","from","the","original","image",".","Args",":","image_shape",":","Shape","of","the","image","(","height",",","width",",","channels",")","from","which","crops","will","be","taken",".","seed",":","Random","seed","for","tf.image.stateless_sample_distorted_bounding_box",".","Returns",":","Two","tensors",",","begin","and","size",",","which","can","be","passed","directly","to","tf.slice","."]
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) for random cropping.
  
      The region is represented as two tensors, `begin` and `size`, which can be
      passed directly to tf.slice to slice the sampled region from the original
      image.
  
      Args:
        image_shape: Shape of the image (height, width, channels) from which crops
          will be taken.
        seed: Random seed for tf.image.stateless_sample_distorted_bounding_box.
  
      Returns:
        Two tensors, begin and size, which can be passed directly to tf.slice.
      """
      raise NotImplementedError(
          f"{self.__class__.__name__} is not implemented."
      )
  
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 5 for calling the RandomCropBase obj's underlying member method code with example usage: obj._sample_random_crop_region() without return types