class_docstr: Dataset for Flickr Annotations
class_docstr_tok: ["Dataset","for","Flickr","Annotations"]
code: def _load_annotation_db(self, splits_path):
      data = []
  
      with PathManager.open(splits_path, "r") as f:
          annotations_json = json.load(f)
  
      for image in annotations_json["images"]:
          if image["split"] in self.splits:
              data.append(
                  {
                      "image_path": image["filename"],
                      "sentences": [
                          s["raw"] for s in image["sentences"]
                      ],
                  }
              )
  
      if len(data) == 0:
          raise RuntimeError("Dataset is empty")
  
      self.samples_factor = len(data[0]["sentences"])
      self.data = data
  
file_path: mmf/mmf/datasets/builders/retrieval/datasets.py
imports: import json
  import pandas
  import torch
  from mmf.utils.file_io import PathManager
label_desc: Use image node_id 2 for calling the CaptionsDatabase obj's underlying member method code with example usage: obj._load_annotation_db(splits_path) without return types