code: def main():
      parser = argparse.ArgumentParser(
          description="Create the iNaturalist2018 data information file."
      )
      parser.add_argument(
          "-i",
          "--input_dir_path",
          type=str,
          help="Path to the parent directory of the iNaturalist2018 data set",
      )
      parser.add_argument(
          "-o",
          "--output_dir_path",
          type=str,
          help="Folder where the classification dataset will be written",
      )
      parser.add_argument(
          "-d",
          "--download",
          action="store_const",
          const=True,
          default=False,
          help="To download the original dataset and decompress it in the input folder",
      )
      args = parser.parse_args()
  
      # Make sure that the input and output directories exist.
      assert g_pathmgr.exists(
          args.input_dir_path
      ), "Data input directory not found! Please create the directory"
      assert g_pathmgr.exists(
          args.output_dir_path
      ), "Data output directory not found! Please create the directory"
  
      # Download dataset to input path
      if args.download:
          download_dataset(args.input_dir_path)
  
      # Process training and validation datasets into numpy arrays
      logger.info("========Preparing train data files========")
      train_images, train_labels = get_images_labels_info(
          "/train2018.json", args.input_dir_path
      )
      logger.info("========Preparing val data files========")
      val_images, val_labels = get_images_labels_info(
          "/val2018.json", args.input_dir_path
      )
  
      # Save as numpy files to output path
      logger.info(
          "=================Saving train data files======================="
      )
      train_label_file_name = (
          f"{ args.output_dir_path }/train_labels.npy"
      )
      train_image_file_name = (
          f"{ args.output_dir_path }/train_images.npy"
      )
      save_file(train_images, train_image_file_name)
      save_file(train_labels, train_label_file_name)
  
      logger.info(
          "=================Saving val data files======================="
      )
      val_label_file_name = f"{ args.output_dir_path }/val_labels.npy"
      val_image_file_name = f"{ args.output_dir_path }/val_images.npy"
      save_file(val_images, val_image_file_name)
      save_file(val_labels, val_label_file_name)
  
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 3 for calling a global function with example usage: main() without return types