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","."]
code: def apply_boxes(
      self,
      boxes: tf.Tensor,
      *,
      image_size: transforms.SizeTuple,
      seed: tf.Tensor,
  ) -> tf.Tensor:
      image_shape = tf.concat([image_size, [1]], axis=0)
      begin, size = self._sample_random_crop_region(
          image_shape=image_shape, seed=seed
      )
      top, left, _ = tf.unstack(begin)
      h, w, _ = tf.unstack(size)
      return transforms.crop_or_pad_boxes(
          boxes,
          top=top,
          left=left,
          height=h,
          width=w,
          h_orig=image_size[0],
          w_orig=image_size[1],
      )
  
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 3 for calling the RandomCropBase obj's underlying member method code with example usage: obj.apply_boxes(boxes) and returns: transforms