code: def isPointInTri(point, tri_points):
      """Judge whether the point is in the triangle
      Method:
          http://blackpawn.com/texts/pointinpoly/
      Args:
          point: (2,). [u, v] or [x, y]
          tri_points: (3 vertices, 2 coords). three vertices(2d points) of a triangle.
      Returns:
          bool: true for in triangle
      """
      tp = tri_points
  
      # vectors
      v0 = tp[2, :] - tp[0, :]
      v1 = tp[1, :] - tp[0, :]
      v2 = point - tp[0, :]
  
      # dot products
      dot00 = np.dot(v0.T, v0)
      dot01 = np.dot(v0.T, v1)
      dot02 = np.dot(v0.T, v2)
      dot11 = np.dot(v1.T, v1)
      dot12 = np.dot(v1.T, v2)
  
      # barycentric coordinates
      if dot00 * dot11 - dot01 * dot01 == 0:
          inverDeno = 0
      else:
          inverDeno = 1 / (dot00 * dot11 - dot01 * dot01)
  
      u = (dot11 * dot02 - dot01 * dot12) * inverDeno
      v = (dot00 * dot12 - dot01 * dot02) * inverDeno
  
      # check if point in triangle
      return (u >= 0) & (v >= 0) & (u + v < 1)
  
file_path: insightface/python-package/insightface/thirdparty/face3d/mesh_numpy/render.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from time import time
label_desc: Use image node_id 1 for calling a global function with example usage: isPointInTri(point, tri_points) and returns: unknown