class_docstr: Base class for all image preprocess ops.
class_docstr_tok: ["Base","class","for","all","image","preprocess","ops","."]
code: def __call__(self, features: Features) -> Features:
      # Copy input features to ensure that they are not accidentally modified in
      # place:
      features = dict(features)
  
      # Apply to images:
      image_size = None
      if self.image_key in features:
          image_size = transforms.get_dynamic_size(
              features[self.image_key]
          )
          features[self.image_key] = self.apply(
              features[self.image_key]
          )
  
      # Apply to boxes:
      if self.boxes_key in features:
          if image_size is None:
              raise ValueError(
                  "When providing box features, image features are also required, so "
                  "that the image size can be computed."
              )
          features[self.boxes_key] = self.apply_boxes(
              features[self.boxes_key], image_size
          )
  
      return features
  
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 ImagePreprocessOp obj's underlying member method code with example usage: obj.__call__(features) and returns: features