code: def create_spiral_path(
      cameras: PinholeCamera,
      rad: float,
      num_views: int,
      num_circles: int,
  ) -> PinholeCamera:
      r"""Creates a PinholeCamera object with cameras that follow a spiral path. Used for novel view synthesis for
      face facing models.
  
      Args:
          cameras: Scene cameras used to train the NeRF model: PinholeCamera
          rad: Spiral radius: float
          num_views: Number of created cameras: int
          num_circles: Number of spiral circles: int
      """
      # Average locations over all cameras
      mean_center = cameras.translation_vector.mean(0, False).squeeze(
          -1
      )
      device = cameras.intrinsics.device
      t = torch.linspace(
          0, 2 * math.pi * num_circles, num_views, device=device
      )
      cos_t = cos(t) * rad
      sin_t = -sin(t) * rad
      sin_05t = -sin(0.5 * t) * rad
      translation_vector = torch.unsqueeze(mean_center, dim=0) + stack(
          (cos_t, sin_t, sin_05t)
      ).permute((1, 0))
      mean_intrinsics = cameras.intrinsics.mean(0, True).repeat(
          num_views, 1, 1
      )
      mean_extrinsics = cameras.extrinsics.mean(0, True).repeat(
          num_views, 1, 1
      )
      extrinsics = mean_extrinsics
      extrinsics[:, :3, 3] = translation_vector
      height = torch.tensor(
          [cameras.height[0]] * num_views, device=device
      )
      width = torch.tensor(
          [cameras.width[0]] * num_views, device=device
      )
      return PinholeCamera(mean_intrinsics, extrinsics, height, width)
  
file_path: kornia/kornia/nerf/camera_utils.py
imports: import math
  from typing import List, Tuple, Union
  import torch
  from kornia.core import Device, Tensor, cos, sin, stack
  from kornia.geometry.camera import PinholeCamera
  from kornia.geometry.conversions import quaternion_to_rotation_matrix
label_desc: Use image node_id 3 for calling a global function with example usage: create_spiral_path(cameras, rad, num_views, num_circles) and returns: PinholeCamera