faceSwap.py
def applyConvexHull(self, landmark_points1, landmark_points2):
        """Find the convex hull of each landmark points.

        Parameters
        ----------
        points1 : list
            a list of tuple integer of landmark points 1.
        points2 : list
            a list of tuple integer of landmark points 2.

        Returns
        -------
        hull1 : list
            return a list of tuple integer of convex hull points bounding landmark points 1.
        hull2 : list
            return a list of tuple integer of convex hull points bounding landmark points 2.
        """

        # Find convex hull of the two landmark points
        hull1 = []
        hull2 = []

        hullIndex1 = cv2.convexHull(
            np.array(landmark_points1), returnPoints=False)
        hullIndex2 = cv2.convexHull(
            np.array(landmark_points2), returnPoints=False)

        # use the minimum number of convex hull points to avoid index out of bound.
        if len(hullIndex1) < len(hullIndex2):
            hullIndex = hullIndex1
        else:
            hullIndex = hullIndex2

        for i in range(len(hullIndex)):
            hull1.append(landmark_points1[int(hullIndex[i])])
            hull2.append(landmark_points2[int(hullIndex[i])])

        return hull1, hull2
Find the convex hull of each landmark points.

        Parameters
        ----------
        points1 : list
            a list of tuple integer of landmark points 1.
        points2 : list
            a list of tuple integer of landmark points 2.

        Returns
        -------
        hull1 : list
            return a list of tuple integer of convex hull points bounding landmark points 1.
        hull2 : list
            return a list of tuple integer of convex hull points bounding landmark points 2.
        
Find the convex hull of each landmark points.
Parameters

points1 : list
a list of tuple integer of landmark points 1.
points2 : list
a list of tuple integer of landmark points 2.

Returns

hull1 : list
return a list of tuple integer of convex hull points bounding landmark points 1.
hull2 : list
return a list of tuple integer of convex hull points bounding landmark points 2.
Find the convex hull of each landmark points . Parameters points1 : list a list of tuple integer of landmark points 1 . points2 : list a list of tuple integer of landmark points 2 . Returns hull1 : list return a list of tuple integer of convex hull points bounding landmark points 1 . hull2 : list return a list of tuple integer of convex hull points bounding landmark points 2 .
def applyConvexHull(self, landmark_points1, landmark_points2):
        hull1 = []
        hull2 = []
        hullIndex1 = cv2.convexHull(
            np.array(landmark_points1), returnPoints=False)
        hullIndex2 = cv2.convexHull(
            np.array(landmark_points2), returnPoints=False)
        if len(hullIndex1) < len(hullIndex2):
            hullIndex = hullIndex1
        else:
            hullIndex = hullIndex2
        for i in range(len(hullIndex)):
            hull1.append(landmark_points1[int(hullIndex[i])])
            hull2.append(landmark_points2[int(hullIndex[i])])
        return hull1, hull2
def applyConvexHull ( self , landmark_points1 , landmark_points2 ) : hull1 = [ ] hull2 = [ ] hullIndex1 = cv2 . convexHull ( np . array ( landmark_points1 ) , returnPoints = False ) hullIndex2 = cv2 . convexHull ( np . array ( landmark_points2 ) , returnPoints = False ) if len ( hullIndex1 ) < len ( hullIndex2 ) : hullIndex = hullIndex1 else : hullIndex = hullIndex2 for i in range ( len ( hullIndex ) ) : hull1 . append ( landmark_points1 [ int ( hullIndex [ i ] ) ] ) hull2 . append ( landmark_points2 [ int ( hullIndex [ i ] ) ] ) return hull1 , hull2
Find the convex hull of each landmark points.
Find the convex hull of each landmark points .
"""Find the convex hull of each landmark points.

        Parameters
        ----------
        points1 : list
            a list of tuple integer of landmark points 1.
        points2 : list
            a list of tuple integer of landmark points 2.

        Returns
        -------
        hull1 : list
            return a list of tuple integer of convex hull points bounding landmark points 1.
        hull2 : list
            return a list of tuple integer of convex hull points bounding landmark points 2.
        """ # Find convex hull of the two landmark points # use the minimum number of convex hull points to avoid index out of bound.
self
landmark_points1
landmark_points2