code: def read_extrinsics_text(path):
      """
      Taken from https://github.com/colmap/colmap/blob/dev/scripts/python/read_write_model.py
      """
      images = {}
      with open(path, "r") as fid:
          while True:
              line = fid.readline()
              if not line:
                  break
              line = line.strip()
              if len(line) > 0 and line[0] != "#":
                  elems = line.split()
                  image_id = int(elems[0])
                  qvec = np.array(tuple(map(float, elems[1:5])))
                  tvec = np.array(tuple(map(float, elems[5:8])))
                  camera_id = int(elems[8])
                  image_name = elems[9]
                  elems = fid.readline().split()
                  xys = np.column_stack(
                      [
                          tuple(map(float, elems[0::3])),
                          tuple(map(float, elems[1::3])),
                      ]
                  )
                  point3D_ids = np.array(tuple(map(int, elems[2::3])))
                  images[image_id] = Image(
                      id=image_id,
                      qvec=qvec,
                      tvec=tvec,
                      camera_id=camera_id,
                      name=image_name,
                      xys=xys,
                      point3D_ids=point3D_ids,
                  )
      return images
  
file_path: gaussian-splatting/scene/colmap_loader.py
imports: import numpy
  import collections
  import struct
label_desc: Use image node_id 9 for calling a global function with example usage: read_extrinsics_text(path) and returns: images