Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: points data type = 9 is not supported #15

Open
SleepyGinger opened this issue Mar 28, 2018 · 1 comment
Open

TypeError: points data type = 9 is not supported #15

SleepyGinger opened this issue Mar 28, 2018 · 1 comment

Comments

@SleepyGinger
Copy link

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

@anne27
Copy link

anne27 commented Apr 3, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants