code: def write_obj_with_colors(obj_name, vertices, triangles, colors):
      """Save 3D face model with texture represented by colors.
      Args:
          obj_name: str
          vertices: shape = (nver, 3)
          triangles: shape = (ntri, 3)
          colors: shape = (nver, 3)
      """
      triangles = triangles.copy()
      triangles += 1  # meshlab start with 1
  
      if obj_name.split(".")[-1] != "obj":
          obj_name = obj_name + ".obj"
  
      # write obj
      with open(obj_name, "w") as f:
          # write vertices & colors
          for i in range(vertices.shape[0]):
              # s = 'v {} {} {} \n'.format(vertices[0,i], vertices[1,i], vertices[2,i])
              s = "v {} {} {} {} {} {}\n".format(
                  vertices[i, 0],
                  vertices[i, 1],
                  vertices[i, 2],
                  colors[i, 0],
                  colors[i, 1],
                  colors[i, 2],
              )
              f.write(s)
  
          # write f: ver ind/ uv ind
          [k, ntri] = triangles.shape
          for i in range(triangles.shape[0]):
              # s = 'f {} {} {}\n'.format(triangles[i, 0], triangles[i, 1], triangles[i, 2])
              s = "f {} {} {}\n".format(
                  triangles[i, 2], triangles[i, 1], triangles[i, 0]
              )
              f.write(s)
  
file_path: insightface/python-package/insightface/thirdparty/face3d/mesh/io.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import os
  from skimage import io
  from time import time
  from .cython import mesh_core_cython
label_desc: Use image node_id 3 for calling a global function with example usage: write_obj_with_colors(obj_name, vertices, triangles, colors) without return types