code: def save_mesh(
      sess,
      feed_dict,
      latent_holder,
      point_holder,
      latent,
      occ,
      batch_val,
      hparams,
      pth="meshes",
  ):
      """Generate and save meshes to disk given a trained NASA model."""
      name = batch_val["name"][0].decode("utf-8")
      subject, motion, frame = amass_name_helper(name)
      pth = path.join(hparams.train_dir, pth, frame)
      if not tf.io.gfile.isdir(pth):
          tf.io.gfile.makedirs(pth)
  
      start = hparams.n_parts
      for i in range(start, hparams.n_parts + 1):
          mesh_model = gen_mesh(
              sess,
              feed_dict,
              latent_holder,
              point_holder,
              latent,
              occ,
              batch_val,
              hparams,
              idx=i,
          )
          mesh_name = "full_pred.obj"
          if mesh_model is not None:
              with tf.io.gfile.GFile(
                  path.join(pth, mesh_name), "w"
              ) as fout:
                  mesh_model.export(fout, file_type="obj")
  
      return subject, motion, frame, mesh_model
  
imports: from os import path
  import numpy
  from skimage import measure
  import tensorflow.compat.v1
  from tensorflow_graphics.projects.cvxnet.lib.libmise import mise
  from tensorflow_graphics.projects.nasa.lib import datasets
  from tensorflow_graphics.projects.nasa.lib import models
  import tensorflow_probability
  from tqdm import trange
  import trimesh
label_desc: Use image node_id 3 for calling a global function with example usage: save_mesh(sess, feed_dict, latent_holder, point_holder, latent, occ, batch_val, hparams, pth) and returns: subject,  motion,  frame,  mesh_model