code: def gridify():
      out_folder = "grids_objaverse"
      os.makedirs(out_folder, exist_ok=True)
  
      folder_paths = glob.glob(
          "/scratch/shared/beegfs/stan/scaling_splatter_image/objaverse/*"
      )
      # pixelnerf_root = "/scratch/shared/beegfs/stan/splatter_image/pixelnerf/teddybears"
      folder_paths_test = sorted(
          [fpath for fpath in folder_paths if "gt" not in fpath],
          key=lambda x: int(os.path.basename(x).split("_")[0]),
      )
      """folder_paths_test = [folder_paths_test[i] for i in [5, 7, 12, 15,
                                                          18, 19, 30, 33,
                                                          37, 42, 43, 44,
                                                          48, 51, 64, 66,
                                                          70, 74, 78, 85, 
                                                          89, 91, 92]]"""
  
      # Initialize variables for grid dimensions
      num_examples_row = 6
      rows = num_examples_row
      num_per_ex = 2
      cols = num_examples_row * num_per_ex  # 7 * 2
      im_res = 128
  
      for im_idx in range(100):
          print("Doing frame {}".format(im_idx))
          # for im_name in ["xyz", "colours", "opacity", "scaling"]:
          grid = np.zeros(
              (rows * im_res, cols * im_res, 3), dtype=np.uint8
          )
  
          # Iterate through the folders in the out_folder
          for f_idx, folder_path_test in enumerate(
              folder_paths_test[: num_examples_row * num_examples_row]
          ):
              # if im_name == "xyz":
              #     print(folder_path_test)
              row_idx = f_idx // num_examples_row
              col_idx = f_idx % num_examples_row
              im_path = os.path.join(
                  folder_path_test, "{:05d}.png".format(im_idx)
              )
              im_path_gt = os.path.join(
                  folder_path_test + "_gt", "{:05d}.png".format(im_idx)
              )
              """im_path_pixelnerf = os.path.join(pixelnerf_root, os.path.basename(folder_path_test),
                                               "{:06d}.png".format(im_idx))"""
  
              # im_path = os.path.join(folder_path_test, "{}.png".format(im_name))
              try:
                  im = np.array(Image.open(im_path))
                  im_gt = np.array(Image.open(im_path_gt))
                  # im_pn = np.array(Image.open(im_path_pixelnerf))
                  grid[
                      row_idx * im_res : (row_idx + 1) * im_res,
                      col_idx
                      * num_per_ex
                      * im_res : (col_idx * num_per_ex + 1)
                      * im_res,
                      :,
                  ] = im[:, :, :3]
                  grid[
                      row_idx * im_res : (row_idx + 1) * im_res,
                      (col_idx * num_per_ex + 1)
                      * im_res : (col_idx * num_per_ex + 2)
                      * im_res,
                      :,
                  ] = im_gt[:, :, :3]
                  """grid[row_idx*im_res: (row_idx+1)*im_res,
                   (col_idx * num_per_ex + 2) *im_res: (col_idx* num_per_ex +3)*im_res, : ] = im_pn[:, :, :3]"""
              except FileNotFoundError:
                  a = 0
          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 1 for calling a global function with example usage: gridify() without return types