class_docstr: Input reader for dataset.
class_docstr_tok: ["Input","reader","for","dataset","."]
code: def get_dataset(self, batch_size=64):
      params = self._params
      input_anchors = anchors.Anchors(
          params["min_level"],
          params["max_level"],
          params["num_scales"],
          params["aspect_ratios"],
          params["anchor_scale"],
          params["image_size"],
      )
      anchor_labeler = anchors.AnchorLabeler(
          input_anchors, params["num_classes"]
      )
      example_decoder = tf_example_decoder.TfExampleDecoder()
  
      seed = params["seed"]
      dataset = tf.data.Dataset.list_files(
          self._file_pattern, shuffle=self._is_training, seed=seed
      )
  
      dataset = dataset.repeat()
  
      # Prefetch data from files.
      def _prefetch_dataset(filename):
          return tf.data.TFRecordDataset(filename).prefetch(1)
  
      dataset = dataset.interleave(
          _prefetch_dataset,
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
      dataset = dataset.with_options(self.dataset_options)
      if self._is_training:
          dataset = dataset.shuffle(64, seed=seed)
  
      # Parse the fetched records to input tensors for model function.
      # pylint: disable=g-long-lambda
      map_fn = lambda value: self.dataset_parser(
          value, example_decoder, anchor_labeler
      )
  
      # pylint: enable=g-long-lambda
      dataset = dataset.map(
          map_fn, num_parallel_calls=tf.data.experimental.AUTOTUNE
      )
      dataset = dataset.prefetch(batch_size)
      dataset = dataset.batch(
          batch_size, drop_remainder=params["drop_remainder"]
      )
      dataset = dataset.map(
          lambda *args: self.process_example(batch_size, *args)
      )
      dataset = dataset.prefetch(tf.data.experimental.AUTOTUNE)
      if self._use_fake_data:
          # Turn this dataset into a semi-fake dataset which always loop at the
          # first batch. This reduces variance in performance and is useful in
          # testing.
          dataset = dataset.take(1).cache().repeat()
      return dataset
  
imports: from absl import logging
  import tensorflow
  import utils
  from pipeline import anchors
  from .None import preprocessor
  from .None import tf_example_decoder
label_desc: Use image node_id 5 for calling the InputReader obj's underlying member method code with example usage: obj.get_dataset(batch_size) and returns: dataset, tf