docstr: Test FishEye Camera distortions on real meshes
docstr_tok: ["Test","FishEye","Camera","distortions","on","real","meshes"]
code: def test_fisheye_cow_mesh(self):
      """
      Test FishEye Camera distortions on real meshes
      """
      device = torch.device("cuda:0")
      obj_filename = os.path.join(DATA_DIR, "missing_usemtl/cow.obj")
      mesh = load_objs_as_meshes([obj_filename], device=device)
      R, T = look_at_view_transform(2.7, 0, 180)
      radial_params = torch.tensor([[-1.0, 1.0, 1.0, 0.0, 0.0, -1.0]])
      tangential_params = torch.tensor([[0.5, 0.5]])
      thin_prism_params = torch.tensor([[0.5, 0.5, 0.5, 0.5]])
      combinations = product([False, True], repeat=3)
      for combination in combinations:
          cameras = FishEyeCameras(
              device=device,
              R=R,
              T=T,
              world_coordinates=True,
              use_radial=combination[0],
              use_tangential=combination[1],
              use_thin_prism=combination[2],
              radial_params=radial_params,
              tangential_params=tangential_params,
              thin_prism_params=thin_prism_params,
          )
          raster_settings = RasterizationSettings(
              image_size=512,
              blur_radius=0.0,
              faces_per_pixel=1,
          )
          lights = PointLights(
              device=device, location=[[0.0, 0.0, -3.0]]
          )
          renderer = MeshRenderer(
              rasterizer=MeshRasterizer(
                  cameras=cameras, raster_settings=raster_settings
              ),
              shader=SoftPhongShader(
                  device=device, cameras=cameras, lights=lights
              ),
          )
          images = renderer(mesh)
          rgb = images[0, ..., :3].squeeze().cpu()
          filename = (
              "test_cow_mesh_%s_radial_%s_tangential_%s_prism_%s.png"
              % (
                  FishEyeCameras.__name__,
                  combination[0],
                  combination[1],
                  combination[2],
              )
          )
          image_ref = load_rgb_image(filename, DATA_DIR)
          if DEBUG:
              filename = filename.replace("test", "DEBUG")
              Image.fromarray(
                  (rgb.numpy() * 255).astype(np.uint8)
              ).save(DATA_DIR / filename)
          self.assertClose(rgb, image_ref, atol=0.05)
  
imports: import os
  import unittest
  from collections import namedtuple
  from itertools import product
  import numpy
  import torch
  from PIL import Image
  from pytorch3d.io import load_obj, load_objs_as_meshes
  from pytorch3d.renderer import AmbientLights, FoVOrthographicCameras, FoVPerspectiveCameras, look_at_view_transform, Materials, MeshRasterizer, MeshRenderer, MeshRendererWithFragments, OrthographicCameras, PerspectiveCameras, PointLights, RasterizationSettings, TexturesAtlas, TexturesUV, TexturesVertex
  from pytorch3d.renderer.fisheyecameras import FishEyeCameras
  from pytorch3d.renderer.mesh.shader import BlendParams, HardFlatShader, HardGouraudShader, HardPhongShader, SoftPhongShader, SoftSilhouetteShader, SplatterPhongShader, TexturedSoftPhongShader
  from pytorch3d.renderer.opengl import MeshRasterizerOpenGL
  from pytorch3d.structures.meshes import join_meshes_as_batch, join_meshes_as_scene, Meshes
  from pytorch3d.utils.ico_sphere import ico_sphere
  from pytorch3d.utils.torus import torus
  from .common_testing import get_pytorch3d_dir, get_tests_dir, load_rgb_image, TestCaseMixin
label_desc: Use image node_id 35 for calling the TestRenderMeshes obj's underlying member method code with example usage: obj.test_fisheye_cow_mesh() without return types