code: def read_images_meta(cls, images_txt_path, images_dir):
      images_meta = {}
      with open(images_txt_path, "r") as fid:
          line = fid.readline()
          assert (
              line == "# Image list with two lines of data per image:\n"
          )
          line = fid.readline()
          assert (
              line
              == "#   IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMERA_ID, NAME\n"
          )
          line = fid.readline()
          assert line == "#   POINTS2D[] as (X, Y, POINT3D_ID)\n"
          line = fid.readline()
          assert re.search(
              "^# Number of images: \d+, mean observations per image: [-+]?\d*\.\d+|\d+\n$",
              line,
          )
          num_images, mean_ob_per_img = re.findall(
              r"[-+]?\d*\.\d+|\d+", line
          )
          num_images = int(num_images)
          mean_ob_per_img = float(mean_ob_per_img)
  
          for _ in tqdm(range(num_images), desc="reading images meta"):
              elems = fid.readline().split()
              assert len(elems) == 10
              line = fid.readline()
              image_path = os.path.join(images_dir, elems[9])
              assert os.path.isfile(
                  image_path
              ), f"missing file: {image_path}"
              image_id = int(elems[0])
              qw, qx, qy, qz, tx, ty, tz = list(map(float, elems[1:8]))
              t = Translation(np.array([tx, ty, tz], dtype=np.float32))
              r = Rotation(np.array([qw, qx, qy, qz], dtype=np.float32))
              camera_pose = CameraPose(t, r)
              camera_id = int(elems[8])
              assert (
                  image_id not in images_meta
              ), f"duplicated image, id: {image_id}, path: {image_path}"
              images_meta[image_id] = ImageMeta(
                  image_id, camera_pose, camera_id, image_path
              )
      return images_meta
  
file_path: ml-neuman/data_io/colmap_helper.py
imports: import os
  import re
  from collections import namedtuple
  import numpy
  from tqdm import tqdm
  from geometry.basics import Translation, Rotation
  from cameras.camera_pose import CameraPose
  from cameras.pinhole_camera import PinholeCamera
  from cameras import captures
  from scenes import scene
label_desc: Use image node_id 6 for calling the ColmapAsciiReader obj's underlying member method code with example usage: obj.read_images_meta(cls, images_txt_path, images_dir) and returns: images_meta