docstr: Save the cow mesh to a glb file
docstr_tok: ["Save","the","cow","mesh","to","a","glb","file"]
code: def test_save_cow(self):
      """
      Save the cow mesh to a glb file
      """
      # load cow mesh from a glb file
      glb = DATA_DIR / "cow.glb"
      self.assertTrue(glb.is_file())
      device = torch.device("cuda:0")
      mesh = _load(glb, device=device)
  
      # save the mesh to a glb file
      glb = DATA_DIR / "cow_write.glb"
      _write(mesh, glb)
  
      # load again
      glb_reload = DATA_DIR / "cow_write.glb"
      self.assertTrue(glb_reload.is_file())
      device = torch.device("cuda:0")
      mesh_reload = _load(glb_reload, device=device)
  
      # assertions
      self.assertEqual(mesh_reload.faces_packed().shape, (5856, 3))
      self.assertEqual(mesh_reload.verts_packed().shape, (3225, 3))
      self.assertClose(
          mesh_reload.get_bounding_boxes().cpu(),
          mesh.get_bounding_boxes().cpu(),
      )
  
      self.assertClose(
          mesh_reload.textures.verts_uvs_padded().cpu(),
          mesh.textures.verts_uvs_padded().cpu(),
      )
  
      self.assertClose(
          mesh_reload.textures.faces_uvs_padded().cpu(),
          mesh.textures.faces_uvs_padded().cpu(),
      )
  
      self.assertClose(
          mesh_reload.textures.maps_padded().cpu(),
          mesh.textures.maps_padded().cpu(),
      )
  
imports: import os.path
  import unittest
  from math import radians
  import numpy
  import torch
  from PIL import Image
  from pytorch3d.io import IO
  from pytorch3d.io.experimental_gltf_io import _read_header, MeshGlbFormat
  from pytorch3d.renderer import AmbientLights, BlendParams, FoVPerspectiveCameras, look_at_view_transform, PointLights, RasterizationSettings, rotate_on_spot
  from pytorch3d.renderer.mesh import HardPhongShader, MeshRasterizer, MeshRenderer, TexturesVertex
  from pytorch3d.structures import Meshes
  from pytorch3d.transforms import axis_angle_to_matrix
  from pytorch3d.utils import ico_sphere
  from pytorch3d.vis.texture_vis import texturesuv_image_PIL
  from .common_testing import get_pytorch3d_dir, get_tests_dir, TestCaseMixin
label_desc: Use image node_id 3 for calling the TestMeshGltfIO obj's underlying member method code with example usage: obj.test_save_cow() without return types