class_docstr: DatasetBuilder for davis dataset.
class_docstr_tok: ["DatasetBuilder","for","davis","dataset","."]
docstr: Yields examples in the form of key, dataset dictionary.
docstr_tok: ["Yields","examples","in","the","form","of","key",",","dataset","dictionary","."]
code: def _generate_examples(self, path):
      """Yields examples in the form of key, dataset dictionary."""
  
      videos_to_include = path.read_text().splitlines()
      root_path = (
          path.parent.parent.parent
      )  # Move up three directories.
      resolution = (
          "Full-Resolution"
          if self.builder_config.full_resolution
          else "480p"
      )
      for video in videos_to_include:
          images_path = root_path / "JPEGImages" / resolution / video
          annotations_path = (
              root_path / "Annotations" / resolution / video
          )
          seq_len = len(list(images_path.iterdir()))
          images = []
          annotations = []
          for i in range(seq_len):
              image_fname = f"{i:05d}.jpg"
              image_path = images_path / image_fname
              annotation_fname = f"{i:05d}.png"
              annotation_path = annotations_path / annotation_fname
              annotation = _read_annotation(annotation_path)
              images.append(image_path)
              annotations.append(annotation)
  
          video_dict = {"frames": images, "segmentations": annotations}
          metadata = {"num_frames": seq_len, "video_name": video}
          key = video + resolution
          yield key, {"video": video_dict, "metadata": metadata}
  
file_path: datasets/tensorflow_datasets/video/davis/davis.py
imports: from __future__ import annotations
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Davis obj's underlying member method code with example usage: obj._generate_examples(path) without return types