class_docstr: Decodes image feature and scales to [0, 1] range.
class_docstr_tok: ["Decodes","image","feature","and","scales","to","[","0",",","1","]","range","."]
code: def __call__(self, features: Features) -> Features:
      image = features[self.input_image_key]
  
      # Some TFDS input pipeline configurations don't decode images by default.
      # pytype: disable=attribute-error  # allow-recursive-types
      if image.dtype == tf.string:
          # Decodes common image formats into uint8.
          image = tf.image.decode_image(image, channels=self.channels)
  
      if image.dtype == tf.uint8:
          image = tf.cast(image, tf.float32) / 255.0
      elif image.dtype == tf.float32:
          tf.debugging.assert_greater_equal(image, 0.0)
          tf.debugging.assert_less_equal(image, 1.0)
      else:
          raise ValueError(
              f"Unsupported dtype for image feature: {image.dtype}"
          )
      # pytype: enable=attribute-error  # allow-recursive-types
  
      features[self.image_key] = image
      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 DecodeImage obj's underlying member method code with example usage: obj.__call__(features) and returns: features