class_docstr: A dataset class to generate random poses.
class_docstr_tok: ["A","dataset","class","to","generate","random","poses","."]
docstr: Initializes a new RandomPosesDataset instance.
  
  Parameters:
      internal_batch_size (int): Number of samples to pre-generate internally.
      height (int): Height of the image.
      width (int): Width of the image.
      radius_range (Tuple[float, float]): Range of generated radii.
      theta_range (Tuple[float, float]): Range of generated theta angles.
      phi_range (Tuple[float, float]): Range of generated phi angles.
      fovx_range (Tuple[float, float]): Range of generated field of view in x-direction.
      default_fovx (float): Default field of view in x-direction.
      fovy_range (Tuple[float, float]): Range of generated field of view angles in y-direction.
      default_fovy (float): Default field of view in y-direction.
      default_radius (float): Default radius of the circle.
      default_polar (float): Default polar angle.
      default_azimuth (float): Default azimuth angle.
      jitter (bool): Whether to jitter the poses.
      jitter_center (float): Jittering center range.
      jitter_target (float): Jittering target range.
      jitter_up (float): Jittering up range.
      angle_overhead (float): Overhead angle.
      angle_front (float): Frontal angle.
      uniform_sphere_rate (float): Rate of sampling uniformly on a sphere.
      near (float): Near clipping distance.
      far (float): Far clipping distance.
      device (torch.device): Device to generate data on.
docstr_tok: ["Initializes","a","new","RandomPosesDataset","instance",".","Parameters",":","internal_batch_size","(","int",")",":","Number","of","samples","to","pre-generate","internally",".","height","(","int",")",":","Height","of","the","image",".","width","(","int",")",":","Width","of","the","image",".","radius_range","(","Tuple","[","float",",","float","]",")",":","Range","of","generated","radii",".","theta_range","(","Tuple","[","float",",","float","]",")",":","Range","of","generated","theta","angles",".","phi_range","(","Tuple","[","float",",","float","]",")",":","Range","of","generated","phi","angles",".","fovx_range","(","Tuple","[","float",",","float","]",")",":","Range","of","generated","field","of","view","in","x-direction",".","default_fovx","(","float",")",":","Default","field","of","view","in","x-direction",".","fovy_range","(","Tuple","[","float",",","float","]",")",":","Range","of","generated","field","of","view","angles","in","y-direction",".","default_fovy","(","float",")",":","Default","field","of","view","in","y-direction",".","default_radius","(","float",")",":","Default","radius","of","the","circle",".","default_polar","(","float",")",":","Default","polar","angle",".","default_azimuth","(","float",")",":","Default","azimuth","angle",".","jitter","(","bool",")",":","Whether","to","jitter","the","poses",".","jitter_center","(","float",")",":","Jittering","center","range",".","jitter_target","(","float",")",":","Jittering","target","range",".","jitter_up","(","float",")",":","Jittering","up","range",".","angle_overhead","(","float",")",":","Overhead","angle",".","angle_front","(","float",")",":","Frontal","angle",".","uniform_sphere_rate","(","float",")",":","Rate","of","sampling","uniformly","on","a","sphere",".","near","(","float",")",":","Near","clipping","distance",".","far","(","float",")",":","Far","clipping","distance",".","device","(","torch.device",")",":","Device","to","generate","data","on","."]
code: def __init__(
      self,
      internal_batch_size: int = 100,
      height: int = 256,
      width: int = 256,
      radius_range: Tuple[float, float] = [3.0, 3.5],
      theta_range: Tuple[float, float] = [45.0, 105.0],
      phi_range: Tuple[float, float] = [-180.0, 180.0],
      fovx_range: Tuple[float, float] = [10.0, 30.0],
      default_fovx: float = 20.0,
      fovy_range: Tuple[float, float] = [10.0, 30.0],
      default_fovy: float = 20.0,
      default_radius: float = 3.2,
      default_polar: float = 90.0,
      default_azimuth: float = 0.0,
      jitter: bool = False,
      jitter_center: float = 0.2,
      jitter_target: float = 0.2,
      jitter_up: float = 0.02,
      angle_overhead: float = 30.0,
      angle_front: float = 60.0,
      uniform_sphere_rate: float = 0.0,
      near: float = 0.01,
      far: float = 1000.0,
      device: torch.device = "cpu",
  ) -> None:
      """
      Initializes a new RandomPosesDataset instance.
  
      Parameters:
          internal_batch_size (int): Number of samples to pre-generate internally.
          height (int): Height of the image.
          width (int): Width of the image.
          radius_range (Tuple[float, float]): Range of generated radii.
          theta_range (Tuple[float, float]): Range of generated theta angles.
          phi_range (Tuple[float, float]): Range of generated phi angles.
          fovx_range (Tuple[float, float]): Range of generated field of view in x-direction.
          default_fovx (float): Default field of view in x-direction.
          fovy_range (Tuple[float, float]): Range of generated field of view angles in y-direction.
          default_fovy (float): Default field of view in y-direction.
          default_radius (float): Default radius of the circle.
          default_polar (float): Default polar angle.
          default_azimuth (float): Default azimuth angle.
          jitter (bool): Whether to jitter the poses.
          jitter_center (float): Jittering center range.
          jitter_target (float): Jittering target range.
          jitter_up (float): Jittering up range.
          angle_overhead (float): Overhead angle.
          angle_front (float): Frontal angle.
          uniform_sphere_rate (float): Rate of sampling uniformly on a sphere.
          near (float): Near clipping distance.
          far (float): Far clipping distance.
          device (torch.device): Device to generate data on.
      """
  
      super().__init__()
      self.height = height
      self.width = width
      self.internal_batch_size = internal_batch_size
  
      # TODO(ahmadki): expose for models other than dreamfusion
      self.progressive_view = False
      self.progressive_view_start_step = 0
      self.progressive_view_end_step = 500
  
      self.default_fovx = default_fovx
      self.default_fovy = default_fovy
      self.default_radius = default_radius
      self.default_polar = default_polar
      self.default_azimuth = default_azimuth
      self.same_fov_random = True
  
      self.radius_range = radius_range
      self.theta_range = theta_range
      self.phi_range = phi_range
      self.fovx_range = fovx_range
      self.fovy_range = fovy_range
  
      self.current_radius_range = radius_range
      self.current_theta_range = theta_range
      self.current_phi_range = phi_range
      self.current_fovx_range = fovx_range
      self.current_fovy_range = fovy_range
  
      self.angle_overhead = angle_overhead
      self.angle_front = angle_front
      self.uniform_sphere_rate = uniform_sphere_rate
      self.jitter = jitter
      self.jitter_center = jitter_center
      self.jitter_target = jitter_target
      self.jitter_up = jitter_up
  
      self.near = near
      self.far = far
  
      self.device = device
  
      # TODO(ahmadki): make camera type a parameter
      self.camera = PinholeCamera(
          width=self.width,
          height=self.height,
          near=self.near,
          far=self.far,
          device=self.device,
      )
  
file_path: NeMo/nemo/collections/multimodal/data/nerf/random_poses.py
imports: import random
  from typing import Any, Dict, Iterator, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn.functional
  from torch.utils.data import IterableDataset
  from nemo.collections.multimodal.data.nerf.cameras import PinholeCamera
  from nemo.collections.multimodal.data.nerf.utils import compute_look_at_vectors, construct_poses, get_rays, get_view_direction
label_desc: Use image node_id 1 to create a new RandomPosesDataset object from inherited base classes: IterableDataset with example: obj = RandomPosesDataset(internal_batch_size, height, width, radius_range, theta_range, phi_range, fovx_range, default_fovx, fovy_range, default_fovy, default_radius, default_polar, default_azimuth, jitter, jitter_center, jitter_target, jitter_up, angle_overhead, angle_front, uniform_sphere_rate, near, far, device)