code: def get_pp_decode_frames(
      channels: int = 3,
  ) -> Callable[[tf.Tensor], tf.Tensor]:
      """Decode encoded frame image strings, see tf.io.decode_image."""
  
      def _decode_frames(
          frame_strings: tf.Tensor,
      ) -> tf.Tensor:  # pylint: disable=missing-docstring
          # tf.io.decode_image does not set the shape correctly, so we use
          # tf.io.decode_jpeg, which also works for png, see
          # https://github.com/tensorflow/tensorflow/issues/8551
          return tf.map_fn(
              functools.partial(tf.io.decode_jpeg, channels=channels),
              frame_strings,
              back_prop=False,
              dtype=tf.uint8,
          )
  
      return _decode_frames
  
file_path: scenic/scenic/projects/lang4video/pp_ops.py
imports: from collections.abc import Callable
  import functools
  from typing import Optional
  from dmvr import processors
  from dmvr import tokenizers
  import ml_collections
  from scenic.dataset_lib.big_transfer.preprocessing import utils
  from scenic.dataset_lib.big_transfer.registry import Registry
  from scenic.projects.lang4video import util
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: get_pp_decode_frames(channels) and returns: _decode_frames, tf