code: def create_revisited_oxford_paris_dataset(
      input_path: str, output_path: str, dataset_name="rparis6k"
  ):
      """
      Following the VTAB protocol, we create a train and test split of
      such that:
      - 30 images of each cateogy end up in the training set
      - the remaining images end up in the test set
      """
      # Make database and query paths.
      database_path = os.path.join(output_path, "database")
      query_path = os.path.join(output_path, "queries")
      os.makedirs(database_path, exist_ok=True)
      os.makedirs(query_path, exist_ok=True)
  
      # Create .npy filelists for all splits.
      cfg = load_file(
          os.path.join(output_path, f"gnd_{dataset_name}.pkl")
      )
      queries = np.array(cfg["qimlist"])
      database = np.array(cfg["imlist"])
  
      print(f"{len(queries)} images in queries")
      print(f"{len(database)} images in database")
  
      query_filelist, query_labels = [], []
      for i, query in enumerate(queries):
          # Move file to query path.
          from_filepath = os.path.join(input_path, f"{query}.jpg")
          to_filepath = os.path.join(
              output_path, "queries", f"{query}.jpg"
          )
          shutil.move(from_filepath, to_filepath)
  
          # Create filelist of image paths.
          query_filelist.append(to_filepath)
  
          # Create easy, medium, and hard splits as per: https://arxiv.org/abs/1803.11285
          labels = {
              "easy": cfg["gnd"][i]["easy"],
              "easy_images": database[cfg["gnd"][i]["easy"]],
              "hard": cfg["gnd"][i]["hard"],
              "hard_images": database[cfg["gnd"][i]["hard"]],
              "junk": cfg["gnd"][i]["junk"],
              "junk_images": database[cfg["gnd"][i]["junk"]],
              "bbx": cfg["gnd"][i]["bbx"],
          }
          query_labels.append(labels)
  
      query_images_path = os.path.join(output_path, "query_images.npy")
      save_file(
          query_filelist,
          query_images_path,
      )
      query_labels_path = os.path.join(output_path, "query_labels.npy")
      save_file(
          query_labels,
          query_labels_path,
      )
  
      database_filelist = []
      for database_img in database:
          # Move file to query path.
          from_filepath = os.path.join(
              input_path, f"{database_img}.jpg"
          )
          to_filepath = os.path.join(
              output_path, "database", f"{database_img}.jpg"
          )
          shutil.move(from_filepath, to_filepath)
  
          # Create database split
          database_filelist.append(to_filepath)
  
      database_images_path = os.path.join(
          output_path, "database_images.npy"
      )
      save_file(database_filelist, database_images_path)
  
file_path: vissl/extra_scripts/datasets/create_rparis_dataset.py
imports: import argparse
  import os
  import shutil
  import numpy
  from vissl.utils.download import download_and_extract_archive, download_url
  from vissl.utils.io import cleanup_dir, load_file, save_file
label_desc: Use image node_id 3 for calling a global function with example usage: create_revisited_oxford_paris_dataset(input_path, output_path, dataset_name) without return types