code: def get_pose_dataset_dicts(
      dataset_names,
      filter_empty=True,
      min_keypoints=0,
      compute_pseudo_bbox=True,
      proposal_files=None,
  ):
      """
      Load and prepare dataset dicts for instance detection/segmentation and semantic segmentation.
  
      Args:
          dataset_names (list[str]): a list of dataset names
          filter_empty (bool): whether to filter out images without instance annotations
          min_keypoints (int): filter out images with fewer keypoints than
              `min_keypoints`. Set to 0 to do nothing.
          proposal_files (list[str]): if given, a list of object proposal files
              that match each dataset in `dataset_names`.
  
      Returns:
          list[dict]: a list of dicts following the standard dataset dict format.
      """
      assert len(dataset_names)
      dataset_dicts = [
          DatasetCatalog.get(dataset_name)
          for dataset_name in dataset_names
      ]
      for dataset_name, dicts in zip(dataset_names, dataset_dicts):
          assert len(dicts), "Dataset '{}' is empty!".format(
              dataset_name
          )
  
      if proposal_files is not None:
          assert len(dataset_names) == len(proposal_files)
          # load precomputed proposals from proposal files
          dataset_dicts = [
              load_proposals_into_dataset(
                  dataset_i_dicts, proposal_file
              )
              for dataset_i_dicts, proposal_file in zip(
                  dataset_dicts, proposal_files
              )
          ]
  
      dataset_dicts = list(itertools.chain.from_iterable(dataset_dicts))
  
      has_instances = "annotations" in dataset_dicts[0]
      if filter_empty and has_instances:
          dataset_dicts = filter_images_with_only_crowd_annotations(
              dataset_dicts
          )
      if min_keypoints > 0 and has_instances:
          dataset_dicts = filter_images_with_few_keypoints(
              dataset_dicts, min_keypoints
          )
      if compute_pseudo_bbox and has_instances:
          dataset_dicts = compute_pseudo_bbox_with_keypoint_annotation(
              dataset_dicts
          )
  
      if has_instances:
          try:
              class_names = MetadataCatalog.get(
                  dataset_names[0]
              ).thing_classes
              check_metadata_consistency("thing_classes", dataset_names)
              print_instances_class_histogram(
                  dataset_dicts, class_names
              )
          except (
              AttributeError
          ):  # class names are not available for this dataset
              pass
      return dataset_dicts
  
imports: import itertools
  import copy
  import logging
  import numpy
  import torch
  from ..registry.catalog import DatasetCatalog, MetadataCatalog
  from ..detection.detection_dataset import load_proposals_into_dataset, filter_images_with_few_keypoints, filter_images_with_only_crowd_annotations, get_detection_dataset_dicts
  from ..detection.detection_dataset import print_instances_class_histogram, build_batch_data_loader, trivial_batch_collator
  from ..detection.detection_utils import check_metadata_consistency, read_image, filter_empty_instances, annotations_to_instances
  from ..detection.detection_utils import check_image_size, build_augmentation_ranged_clip, transform_instance_annotations
  from ..detection.detection_dataset import DatasetFromList, MapDataset, DatasetMapper
  from ..detection.samplers import RepeatFactorTrainingSampler, TrainingSampler, InferenceSampler
  from ..transforms import instance_transforms
  from ..transforms.instance_transforms import RandomCropWithInstance
  from ..structures import BoxMode
label_desc: Use image node_id 2 for calling a global function with example usage: get_pose_dataset_dicts(dataset_names, filter_empty, min_keypoints, compute_pseudo_bbox, proposal_files) and returns: dataset_dicts