class_docstr: A dataset class to generate random poses.
class_docstr_tok: ["A","dataset","class","to","generate","random","poses","."]
docstr: Generate a batch of random poses.
  
  Returns:
      Tuple[Dict[str, torch.Tensor], Dict[str, torch.Tensor], Dict[str, torch.Tensor], Dict[str, torch.Tensor], Dict[str, torch.Tensor]]:
          A tuple containing:
              - rays (Dict[str, torch.Tensor]): A dictionary containing the origin and direction of the rays.
              - dirs (torch.Tensor): A tensor containing the directions of the rays.
              - mvp (torch.Tensor): A tensor containing the model-view-projection matrix.
              - azimuth (torch.Tensor): A A tensor containing the azimuth angle.
docstr_tok: ["Generate","a","batch","of","random","poses",".","Returns",":","Tuple","[","Dict","[","str",",","torch.Tensor","]",",","Dict","[","str",",","torch.Tensor","]",",","Dict","[","str",",","torch.Tensor","]",",","Dict","[","str",",","torch.Tensor","]",",","Dict","[","str",",","torch.Tensor","]","]",":","A","tuple","containing",":","-","rays","(","Dict","[","str",",","torch.Tensor","]",")",":","A","dictionary","containing","the","origin","and","direction","of","the","rays",".","-","dirs","(","torch.Tensor",")",":","A","tensor","containing","the","directions","of","the","rays",".","-","mvp","(","torch.Tensor",")",":","A","tensor","containing","the","model-view-projection","matrix",".","-","azimuth","(","torch.Tensor",")",":","A","A","tensor","containing","the","azimuth","angle","."]
code: def generate_samples(self):
      """
      Generate a batch of random poses.
  
      Returns:
          Tuple[Dict[str, torch.Tensor], Dict[str, torch.Tensor], Dict[str, torch.Tensor], Dict[str, torch.Tensor], Dict[str, torch.Tensor]]:
              A tuple containing:
                  - rays (Dict[str, torch.Tensor]): A dictionary containing the origin and direction of the rays.
                  - dirs (torch.Tensor): A tensor containing the directions of the rays.
                  - mvp (torch.Tensor): A tensor containing the model-view-projection matrix.
                  - azimuth (torch.Tensor): A A tensor containing the azimuth angle.
      """
      # Generate random poses and directions
      poses, dirs, thetas, phis, radius = rand_poses(
          size=self.internal_batch_size,
          radius_range=self.current_radius_range,
          theta_range=self.current_theta_range,
          phi_range=self.current_phi_range,
          angle_overhead=self.angle_overhead,
          angle_front=self.angle_front,
          uniform_sphere_rate=self.uniform_sphere_rate,
          jitter=self.jitter,
          jitter_center=self.jitter_center,
          jitter_target=self.jitter_target,
          jitter_up=self.jitter_up,
          return_dirs=True,
          device=self.device,
      )
  
      # random focal
      if self.same_fov_random:
          fovx_random = random.random()
          fovy_random = fovx_random
      else:
          fovx_random = random.random()
          fovy_random = random.random()
      fovx = (
          fovx_random
          * (self.current_fovx_range[1] - self.current_fovx_range[0])
          + self.current_fovx_range[0]
      )
      fovy = (
          fovy_random
          * (self.current_fovy_range[1] - self.current_fovy_range[0])
          + self.current_fovy_range[0]
      )
  
      # Compute camera intrinsics
      intrinsics = self.camera.compute_intrinsics(fovx=fovx, fovy=fovy)
  
      # Compute projection matrix
      projection = self.camera.compute_projection_matrix(
          focal_x=intrinsics[0], focal_y=intrinsics[1]
      )
      mvp = projection @ torch.inverse(
          poses
      )  # [internal batch size, 4, 4]
  
      # Sample rays
      rays_o, rays_d = get_rays(
          poses=poses,
          intrinsics=intrinsics,
          height=self.height,
          width=self.width,
          device=poses.device,
      )
  
      # Compute azimuth delta
      delta_azimuth = phis - self.default_azimuth
      delta_azimuth[delta_azimuth > 180] -= 360  # range in [-180, 180]
  
      return rays_o, rays_d, dirs, mvp, delta_azimuth
  
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 5 for calling the RandomPosesDataset obj's underlying member method code with example usage: obj.generate_samples() and returns: rays_o,  rays_d,  dirs,  mvp,  delta_azimuth