code: def readColmapSceneInfo(path, images, eval, llffhold=8):
      try:
          cameras_extrinsic_file = os.path.join(
              path, "sparse/0", "images.bin"
          )
          cameras_intrinsic_file = os.path.join(
              path, "sparse/0", "cameras.bin"
          )
          cam_extrinsics = read_extrinsics_binary(
              cameras_extrinsic_file
          )
          cam_intrinsics = read_intrinsics_binary(
              cameras_intrinsic_file
          )
      except:
          cameras_extrinsic_file = os.path.join(
              path, "sparse/0", "images.txt"
          )
          cameras_intrinsic_file = os.path.join(
              path, "sparse/0", "cameras.txt"
          )
          cam_extrinsics = read_extrinsics_text(cameras_extrinsic_file)
          cam_intrinsics = read_intrinsics_text(cameras_intrinsic_file)
  
      reading_dir = "images" if images == None else images
      cam_infos_unsorted = readColmapCameras(
          cam_extrinsics=cam_extrinsics,
          cam_intrinsics=cam_intrinsics,
          images_folder=os.path.join(path, reading_dir),
      )
      cam_infos = sorted(
          cam_infos_unsorted.copy(), key=lambda x: x.image_name
      )
  
      if eval:
          train_cam_infos = [
              c
              for idx, c in enumerate(cam_infos)
              if idx % llffhold != 0
          ]
          test_cam_infos = [
              c
              for idx, c in enumerate(cam_infos)
              if idx % llffhold == 0
          ]
      else:
          train_cam_infos = cam_infos
          test_cam_infos = []
  
      nerf_normalization = getNerfppNorm(train_cam_infos)
  
      ply_path = os.path.join(path, "sparse/0/points3D.ply")
      bin_path = os.path.join(path, "sparse/0/points3D.bin")
      txt_path = os.path.join(path, "sparse/0/points3D.txt")
      if not os.path.exists(ply_path):
          print(
              "Converting point3d.bin to .ply, will happen only the first time you open the scene."
          )
          try:
              xyz, rgb, _ = read_points3D_binary(bin_path)
          except:
              xyz, rgb, _ = read_points3D_text(txt_path)
          storePly(ply_path, xyz, rgb)
      try:
          pcd = fetchPly(ply_path)
      except:
          pcd = None
  
      scene_info = SceneInfo(
          point_cloud=pcd,
          train_cameras=train_cam_infos,
          test_cameras=test_cam_infos,
          nerf_normalization=nerf_normalization,
          ply_path=ply_path,
      )
      return scene_info
  
imports: import os
  import sys
  from PIL import Image
  from typing import NamedTuple
  from scene.colmap_loader import read_extrinsics_text, read_intrinsics_text, qvec2rotmat, read_extrinsics_binary, read_intrinsics_binary, read_points3D_binary, read_points3D_text
  from utils.graphics_utils import getWorld2View2, focal2fov, fov2focal
  import numpy
  import json
  from pathlib import Path
  from plyfile import PlyData, PlyElement
  from utils.sh_utils import SH2RGB
  from scene.gaussian_model import BasicPointCloud
label_desc: Use image node_id 5 for calling a global function with example usage: readColmapSceneInfo(path, images, eval, llffhold) and returns: scene_info