class_docstr: DatasetBuilder for Movi-B dataset.
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, directories: List[str]):
      """Yields examples."""
  
      target_size = (
          self.builder_config.height,
          self.builder_config.width,
      )
  
      def _process_example(video_dir):
          key, result, metadata = load_scene_directory(
              video_dir, target_size
          )
  
          # add Movi-B specific instance information:
          for i, obj in enumerate(result["instances"]):
              obj["shape_label"] = metadata["instances"][i]["shape"]
              obj["material_label"] = metadata["instances"][i][
                  "material"
              ]
              obj["color"] = np.array(
                  metadata["instances"][i]["color"], dtype=np.float32
              )
          return key, result
  
      beam = tfds.core.lazy_imports.apache_beam
      return (
          beam.Create(directories)
          | beam.Filter(is_complete_dir)
          | beam.Map(_process_example)
      )
  
imports: import dataclasses
  import json
  import logging
  import imageio
  import numpy
  import png
  import tensorflow
  import tensorflow_datasets.public_api
  from typing import List, Dict, Union
label_desc: Use image node_id 3 for calling the MoviB obj's underlying member method code with example usage: obj._generate_examples(directories) and returns: unknown, key,  result