code: def get_images_labels_info(input_file_name: str, input_dir_path: str):
      """
      Process the iNaturalist2018 image paths and labels for the training
      or validation data. This assumes the input_dir_path contains the
      train2018.json and val2018.json files with relative paths to
      training and validation images, respectively, as well as a sub-directory
      with all the raw images
      """
      data_source_path = input_dir_path + input_file_name
      with open(data_source_path) as ds_path:
          data = json.load(ds_path)
  
      images, labels = [], []
  
      assert (
          "images" in data
      ), f"Please check the specified {data_source_path} as it doesn't contain 'images' in it"  # noqa
      for info in data["images"]:
          image = info["file_name"]
          path_elements = image.split("/")
          inaturalist_path = "/".join(path_elements[1:])
          full_path = (
              f"{ input_dir_path }/train_val2018/{inaturalist_path}"
          )
          label = int(path_elements[2])
          images.append(full_path)
          labels.append(label)
      return np.array(images), np.array(labels)
  
file_path: vissl/extra_scripts/datasets/create_inaturalist2018_data_files.py
imports: import argparse
  import json
  import logging
  import sys
  import numpy
  from iopath.common.file_io import g_pathmgr
  from vissl.utils.download import download_and_extract_archive
  from vissl.utils.io import save_file
label_desc: Use image node_id 2 for calling a global function with example usage: get_images_labels_info(input_file_name, input_dir_path) and returns: np,  np