class_docstr: Sun397 Scene Recognition Benchmark.
class_docstr_tok: ["Sun397","Scene","Recognition","Benchmark","."]
code: def _generate_examples(self, archive, subset_images):
      prefix_len = len("SUN397")
      with tf.Graph().as_default():
          with utils.nogpu_session() as sess:
              for filepath, fobj in archive:
                  if filepath in _SUN397_IGNORE_IMAGES:
                      continue
                  # Note: all files in the tar.gz are in SUN397/...
                  filename = filepath[prefix_len:].replace(
                      "\\", "/"
                  )  # For windows
                  if filename in subset_images:
                      # Example:
                      # From filename: /c/car_interior/backseat/sun_aenygxwhhmjtisnf.jpg
                      # To class: /c/car_interior/backseat
                      label = "/".join(filename.split("/")[:-1])
                      image = _process_image_file(
                          fobj,
                          sess,
                          filename,
                          quality=self.builder_config.quality,
                          target_pixels=self.builder_config.target_pixels,
                      )
                      record = {
                          "file_name": filename,
                          "image": image,
                          "label": label,
                      }
                      yield filename, record
  
imports: import io
  import os
  from absl import logging
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 4 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(archive, subset_images) without return types