code: def load_labels_metadata_predictions_images(
      input_data, confidence_threshold=0.0
  ):
      # load the image paths
      image_paths = load_file(input_data["image_paths"])
      print(f"Number of image_paths: {image_paths.shape}\n")
  
      # load the predictions
      predictions = load_file(input_data["predictions"])
      print(f"Number of predictions: {predictions.shape}\n")
  
      # load the indices
      indices = load_file(input_data["pred_img_indices"])
      print(f"Number of indices: {indices.shape}\n")
  
      # load the targets
      targets = load_file(input_data["targets"])
      print(f"Number of targets: {targets.shape}\n")
  
      # load the metadata
      metadata = load_file(input_data["metadata"])
      if isinstance(metadata, list):
          print(f"metadata: {len(metadata)}")
          print(f"metadata keys: {metadata[0].keys()}")
      else:
          print(f"metadata: {list(metadata.values())[0].keys()}")
  
      # load the label id map
      id_to_label = load_file(input_data["id_to_label_map"])
      print(
          f"Loaded label_to_id and generated id_to_label map: {len(id_to_label)}"
      )
  
      # load the confidence scores if provided
      filtered_confidence_scores = []
      if "pred_confidence_scores" in input_data:
          confidence_scores = load_file(
              input_data["pred_confidence_scores"]
          )
          filtered_confidence_scores, out_predictions = [], []
          for img_idx in range(len(predictions)):
              img_predictions, img_scores = [], []
              for pred_idx in predictions[img_idx]:
                  if (
                      confidence_scores[img_idx][pred_idx]
                      >= confidence_threshold
                  ):
                      img_predictions.append(pred_idx)
                      img_scores.append(
                          str(
                              round(
                                  confidence_scores[img_idx][pred_idx],
                                  5,
                              )
                          )
                      )
              filtered_confidence_scores.append(img_scores)
              out_predictions.append(img_predictions)
          predictions = out_predictions
          print(
              f"Confidence scores: {len(filtered_confidence_scores)}\n"
          )
  
      return (
          image_paths,
          predictions,
          indices,
          targets,
          metadata,
          id_to_label,
          filtered_confidence_scores,
      )
  
imports: import json
  import os
  from math import ceil, floor
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from IPython.display import display_html
  from matplotlib.ticker import FixedLocator
  from vissl.utils.io import load_file, save_file
label_desc: Use image node_id 1 for calling a global function with example usage: load_labels_metadata_predictions_images(input_data, confidence_threshold) and returns: image_paths,  predictions,  indices,  targets,  metadata,  id_to_label,  filtered_confidence_scores