faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

TypeError: points data type = 9 is not supported

Open SleepyGinger opened this issue 7 years ago • 1 comments

Was wondering if anyone else got this error...

Here is the full traceback:

File "./faceswap.py", line 208, in mask = get_face_mask(im2, landmarks2) File "./faceswap.py", line 120, in get_face_mask color=1) File "./faceswap.py", line 111, in draw_convex_hull points = cv2.convexHull(points) TypeError: points data type = 9 is not supported

SleepyGinger avatar Mar 28 '18 20:03 SleepyGinger

Faced the same issue.

Try adding the following line points=points.astype(numpy.int32) to the draw_convex_hull function.

def draw_convex_hull(im, points, color):         points=points.astype(numpy.int32)         points = cv2.convexHull(points)         cv2.fillConvexPoly(im, points, color=color)

This is to make the data type compatible with the cv2 function.

anne27 avatar Apr 03 '18 17:04 anne27