code: def comparisons():
      out_root = "hydrants_comparisons"
      os.makedirs(out_root, exist_ok=True)
  
      folder_paths = glob.glob(
          "/users/stan/pixel-nerf/full_eval_hydrant/*"
      )
      folder_paths_test = sorted(folder_paths)
      folder_paths_ours_root = (
          "/scratch/shared/beegfs/stan/out_hydrants_with_lpips_ours"
      )
  
      # Initialize variables for grid dimensions
      rows = 3
      cols = 1
      im_res = 128
  
      for f_idx, folder_path_test in enumerate(folder_paths_test):
          example_id = "_".join(
              os.path.basename(folder_path_test).split("_")[1:]
          )
          out_folder = os.path.join(out_root, example_id)
          os.makedirs(out_folder, exist_ok=True)
          num_images = len(
              [
                  p
                  for p in glob.glob(
                      os.path.join(folder_path_test, "*.png")
                  )
                  if "gt" not in p
              ]
          )
  
          grid = np.zeros(
              (rows * im_res, cols * im_res, 3), dtype=np.uint8
          )
  
          for im_idx in range(num_images):
              im_path_pixelnerf = os.path.join(
                  folder_path_test, "{:06d}.png".format(im_idx + 1)
              )
              im_path_ours = os.path.join(
                  folder_paths_ours_root,
                  example_id,
                  "{:05d}.png".format(im_idx),
              )
              im_path_gt = os.path.join(
                  folder_paths_ours_root,
                  example_id + "_gt",
                  "{:05d}.png".format(im_idx),
              )
              # im_path = os.path.join(folder_path_test, "{}.png".format(im_name))
  
              im_pn = np.array(Image.open(im_path_pixelnerf))
              im_ours = np.array(Image.open(im_path_ours))
              im_gt = np.array(Image.open(im_path_gt))
  
              grid[:im_res, :, :] = im_pn
              grid[im_res : 2 * im_res, :, :] = im_ours
              grid[2 * im_res : 3 * im_res, :, :] = im_gt
  
              im_out = Image.fromarray(grid)
              im_out.save(
                  os.path.join(out_folder, "{:05d}.png".format(im_idx))
              )
  
file_path: splatter-image/utils/vis_utils.py
imports: import glob
  import os
  from PIL import Image
  import numpy
  import torch
  from matplotlib import pyplot
  from utils.sh_utils import eval_sh
  from einops import rearrange
label_desc: Use image node_id 2 for calling a global function with example usage: comparisons() without return types