class_docstr: Reader for TFRecords using the MediaSequence format.
  
  The TFrecords already contain images and spectrograms. Spectrograms are
  extracted per second and stored with size 128x100 for each second of audio.
docstr: Adds DMVR pre-processors to the dataset.
  
  Args:
    is_training: whether or not in training mode.
    num_frames: number of frames per subclip.
    stride: temporal stride to sample frames.
    num_spec_frames: number of spectrogram frames.
    spec_stride: stride to sample spectrogram.
    dataset_spec_mean: Mean of spectrograms in the dataset.
    dataset_spec_stddev: Std dev of spectrograms in the dataset.
    num_test_clips: number of test clip (1 by default). If more than one, this
      will sample multiple linearly spaced clips within each video at test
      time. If 1, then a single clip in the middle of the video is sampled.
    min_resize: frames are resized so that min width/height is min_resize.
    crop_size: final size of the frame after cropping the resized frames.
    spec_shape: input size of spectrogram per frame.
    spec_augment: whether to apply augmentation using SpecAugment.
    spec_augment_params: parameters for SpecAugment.
    zero_centering_image: whether to have images between [-1, 1] or [0, 1].
    one_hot_label: whether or not to return one hot version of labels.
    get_label_str: whether or not to return label as text.
docstr_tok: ["Adds","DMVR","pre-processors","to","the","dataset",".","Args",":","is_training",":","whether","or","not","in","training","mode",".","num_frames",":","number","of","frames","per","subclip",".","stride",":","temporal","stride","to","sample","frames",".","num_spec_frames",":","number","of","spectrogram","frames",".","spec_stride",":","stride","to","sample","spectrogram",".","dataset_spec_mean",":","Mean","of","spectrograms","in","the","dataset",".","dataset_spec_stddev",":","Std","dev","of","spectrograms","in","the","dataset",".","num_test_clips",":","number","of","test","clip","(","1","by","default",")",".","If","more","than","one",",","this","will","sample","multiple","linearly","spaced","clips","within","each","video","at","test","time",".","If","1",",","then","a","single","clip","in","the","middle","of","the","video","is","sampled",".","min_resize",":","frames","are","resized","so","that","min","width\/height","is","min_resize",".","crop_size",":","final","size","of","the","frame","after","cropping","the","resized","frames",".","spec_shape",":","input","size","of","spectrogram","per","frame",".","spec_augment",":","whether","to","apply","augmentation","using","SpecAugment",".","spec_augment_params",":","parameters","for","SpecAugment",".","zero_centering_image",":","whether","to","have","images","between","[","-1",",","1","]","or","[","0",",","1","]",".","one_hot_label",":","whether","or","not","to","return","one","hot","version","of","labels",".","get_label_str",":","whether","or","not","to","return","label","as","text","."]
code: def _build(
      self,
      is_training: bool = True,
      # Video related parameters.
      num_frames: int = 32,
      stride: int = 1,
      num_spec_frames: int = 5,
      spec_stride: int = 1,
      dataset_spec_mean: float = 0.0,
      dataset_spec_stddev: float = 1.0,
      num_test_clips: int = 1,
      min_resize: int = 256,
      crop_size: int = 224,
      # Audio related parameters.
      spec_shape: Tuple[int, int] = (100, 128),
      spec_augment: bool = False,
      spec_augment_params=None,
      zero_centering_image: bool = False,
      # Label related parameters.
      one_hot_label: bool = True,
      get_label_str: bool = False,
  ):
      """Adds DMVR pre-processors to the dataset.
  
      Args:
        is_training: whether or not in training mode.
        num_frames: number of frames per subclip.
        stride: temporal stride to sample frames.
        num_spec_frames: number of spectrogram frames.
        spec_stride: stride to sample spectrogram.
        dataset_spec_mean: Mean of spectrograms in the dataset.
        dataset_spec_stddev: Std dev of spectrograms in the dataset.
        num_test_clips: number of test clip (1 by default). If more than one, this
          will sample multiple linearly spaced clips within each video at test
          time. If 1, then a single clip in the middle of the video is sampled.
        min_resize: frames are resized so that min width/height is min_resize.
        crop_size: final size of the frame after cropping the resized frames.
        spec_shape: input size of spectrogram per frame.
        spec_augment: whether to apply augmentation using SpecAugment.
        spec_augment_params: parameters for SpecAugment.
        zero_centering_image: whether to have images between [-1, 1] or [0, 1].
        one_hot_label: whether or not to return one hot version of labels.
        get_label_str: whether or not to return label as text.
      """
      # We set sync_random_state to True so that sample_offset_proportion is
      # the same for all modalities.
      if "rgb" in self._modalities:
          load_modalities.add_image(
              parser_builder=self.parser_builder,
              sampler_builder=self.sampler_builder,
              decoder_builder=self.decoder_builder,
              preprocessor_builder=self.preprocessor_builder,
              postprocessor_builder=self.postprocessor_builder,
              is_training=is_training,
              num_frames=num_frames,
              stride=stride,
              num_test_clips=num_test_clips,
              min_resize=min_resize,
              crop_size=crop_size,
              zero_centering_image=zero_centering_image,
              sync_random_state=True,
          )
      if "spectrogram" in self._modalities:
          add_spectrogram(
              parser_builder=self.parser_builder,
              sampler_builder=self.sampler_builder,
              decoder_builder=self.decoder_builder,
              preprocessor_builder=self.preprocessor_builder,
              postprocessor_builder=self.postprocessor_builder,
              input_shape=spec_shape,
              is_training=is_training,
              num_frames=num_spec_frames,
              stride=spec_stride,
              num_test_clips=num_test_clips,
              spec_augment=spec_augment,
              spec_augment_params=spec_augment_params,
              zero_centering_image=zero_centering_image,
              dataset_mean=dataset_spec_mean,
              dataset_stddev=dataset_spec_stddev,
              sync_random_state=True,
          )
  
      load_modalities.add_label(
          parser_builder=self.parser_builder,
          decoder_builder=self.decoder_builder,
          preprocessor_builder=self.preprocessor_builder,
          is_multi_label=False,
          one_hot_label=True,
          num_classes=self.num_classes,
          add_label_name=False,
      )
  
imports: import functools
  from typing import Dict, Iterator, List, Optional, Text, Tuple, Union
  from absl import logging
  from dmvr import modalities
  from flax import jax_utils
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  from scenic.dataset_lib import video_ops
  from scenic.projects.mbt.datasets.dataset_utils import add_spectrogram
  from scenic.projects.vivit.data import video_tfrecord_dataset
  import tensorflow
label_desc: Use image node_id 2 for calling the AVTFRecordDatasetFactory obj's underlying member method code with example usage: obj._build(is_training, num_frames, stride, num_spec_frames, spec_stride, dataset_spec_mean, dataset_spec_stddev, num_test_clips, min_resize, crop_size, spec_shape, spec_augment, spec_augment_params, zero_centering_image, one_hot_label, get_label_str) without return types