mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 11:19:53 +00:00
fix: numpy typing error
This commit is contained in:
@@ -98,7 +98,9 @@ def mediapipe_face_mesh(image: Image.Image, confidence: float = 0.3) -> PredictO
|
||||
connection_drawing_spec=drawing_styles.get_default_face_mesh_tesselation_style(),
|
||||
)
|
||||
|
||||
points = np.intp([(land.x * w, land.y * h) for land in landmarks.landmark])
|
||||
points = np.array(
|
||||
[[land.x * w, land.y * h] for land in landmarks.landmark], dtype=int
|
||||
)
|
||||
outline = cv2.convexHull(points).reshape(-1).tolist()
|
||||
|
||||
mask = Image.new("L", image.size, "black")
|
||||
@@ -136,7 +138,9 @@ def mediapipe_face_mesh_eyes_only(
|
||||
masks = []
|
||||
|
||||
for landmarks in pred.multi_face_landmarks:
|
||||
points = np.intp([(land.x * w, land.y * h) for land in landmarks.landmark])
|
||||
points = np.array(
|
||||
[[land.x * w, land.y * h] for land in landmarks.landmark], dtype=int
|
||||
)
|
||||
left_eyes = points[left_idx]
|
||||
right_eyes = points[right_idx]
|
||||
left_outline = cv2.convexHull(left_eyes).reshape(-1).tolist()
|
||||
|
||||
Reference in New Issue
Block a user