code: def read_scene(
      cls,
      scene_dir,
      tgt_size=None,
      normalize=False,
      bkg_range_scale=1.1,
      human_range_scale=1.1,
      mask_dir="segmentations",
      smpl_type="romp",
      keypoints_dir="keypoints",
      densepose_dir="densepose",
  ):
      def update_near_far(scene, keys, range_scale):
          # compute the near and far
          for view_id in tqdm(
              range(scene.num_views),
              total=scene.num_views,
              desc=f"Computing near/far for {keys}",
          ):
              for cam_id in range(scene.num_cams):
                  cur_cap = scene.get_capture_by_view_cam_id(
                      view_id, cam_id
                  )
                  if not hasattr(cur_cap, "near"):
                      cur_cap.near = {}
                  if not hasattr(cur_cap, "far"):
                      cur_cap.far = {}
                  for k in keys:
                      if k == "bkg":
                          pcd_2d_bkg = pcd_projector.project_point_cloud_at_capture(
                              scene.point_cloud,
                              cur_cap,
                              render_type="pcd",
                          )
                          near = 0  # np.percentile(pcd_2d_bkg[:, 2], 5)
                          far = np.percentile(pcd_2d_bkg[:, 2], 95)
                      elif k == "human":
                          pcd_2d_human = pcd_projector.project_point_cloud_at_capture(
                              scene.verts[view_id],
                              cur_cap,
                              render_type="pcd",
                          )
                          near = pcd_2d_human[:, 2].min()
                          far = pcd_2d_human[:, 2].max()
                      else:
                          raise ValueError(k)
                      center = (near + far) / 2
                      length = (far - near) * range_scale
                      cur_cap.near[k] = max(
                          0.0, float(center - length / 2)
                      )
                      cur_cap.far[k] = float(center + length / 2)
  
      captures, point_cloud, num_views, num_cams = cls.read_captures(
          scene_dir,
          tgt_size,
          mask_dir=mask_dir,
          keypoints_dir=keypoints_dir,
          densepose_dir=densepose_dir,
      )
      scene = scene_module.RigCameraScene(captures, num_views, num_cams)
      scene.point_cloud = point_cloud
      update_near_far(scene, ["bkg"], bkg_range_scale)
  
      if normalize:
          fars = []
          for cap in scene.captures:
              fars.append(cap.far["bkg"])
          fars = np.array(fars)
          scale = 3.14 / (np.percentile(fars, 95))
          for cap in scene.captures:
              cap.cam_pose.camera_center_in_world *= scale
              cap.near["bkg"], cap.far["bkg"] = (
                  cap.near["bkg"] * scale,
                  cap.far["bkg"] * scale,
              )
              cap.captured_depth.scale = scale
              cap.captured_mono_depth.scale = scale
          scene.point_cloud[:, :3] *= scale
      else:
          scale = 1
  
      scene.scale = scale
      smpls, world_verts, static_verts, Ts = cls.read_smpls(
          scene_dir, scene.captures, scale=scale, smpl_type=smpl_type
      )
      scene.smpls, scene.verts, scene.static_vert, scene.Ts = (
          smpls,
          world_verts,
          static_verts,
          Ts,
      )
      _, uvs, faces = utils.read_obj(
          os.path.join(
              os.path.abspath(
                  os.path.join(os.path.dirname(__file__), "..")
              ),
              "data/smplx/smpl_uv.obj",
          )
      )
      scene.uvs, scene.faces = uvs, faces
      update_near_far(scene, ["human"], human_range_scale)
  
      assert len(scene.captures) > 0
  
      return scene
  
imports: import os
  import joblib
  import numpy
  import torch
  from tqdm import tqdm
  import PIL
  import scipy
  from data_io import colmap_helper
  from geometry import pcd_projector
  from cameras import captures, contents
  from scenes import scene
  from utils import utils, ray_utils
  from models.smpl import SMPL
label_desc: Use image node_id 2 for calling the NeuManReader obj's underlying member method code with example usage: obj.read_scene(cls, scene_dir, tgt_size, normalize, bkg_range_scale, human_range_scale, mask_dir, smpl_type, keypoints_dir, densepose_dir) and returns: scene