code: def readColmapCameras(cam_extrinsics, cam_intrinsics, images_folder):
      cam_infos = []
      for idx, key in enumerate(cam_extrinsics):
          sys.stdout.write("\r")
          # the exact output you're looking for:
          sys.stdout.write(
              "Reading camera {}/{}".format(
                  idx + 1, len(cam_extrinsics)
              )
          )
          sys.stdout.flush()
  
          extr = cam_extrinsics[key]
          intr = cam_intrinsics[extr.camera_id]
          height = intr.height
          width = intr.width
  
          uid = intr.id
          R = np.transpose(qvec2rotmat(extr.qvec))
          T = np.array(extr.tvec)
  
          if intr.model == "SIMPLE_PINHOLE":
              focal_length_x = intr.params[0]
              FovY = focal2fov(focal_length_x, height)
              FovX = focal2fov(focal_length_x, width)
          elif intr.model == "PINHOLE":
              focal_length_x = intr.params[0]
              focal_length_y = intr.params[1]
              FovY = focal2fov(focal_length_y, height)
              FovX = focal2fov(focal_length_x, width)
          else:
              assert (
                  False
              ), "Colmap camera model not handled: only undistorted datasets (PINHOLE or SIMPLE_PINHOLE cameras) supported!"
  
          image_path = os.path.join(
              images_folder, os.path.basename(extr.name)
          )
          image_name = os.path.basename(image_path).split(".")[0]
          image = Image.open(image_path)
  
          cam_info = CameraInfo(
              uid=uid,
              R=R,
              T=T,
              FovY=FovY,
              FovX=FovX,
              image=image,
              image_path=image_path,
              image_name=image_name,
              width=width,
              height=height,
          )
          cam_infos.append(cam_info)
      sys.stdout.write("\n")
      return cam_infos
  
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 2 for calling a global function with example usage: readColmapCameras(cam_extrinsics, cam_intrinsics, images_folder) and returns: cam_infos