From 9deb9bea0d46b085d171d9a417671f6ef1af2f69 Mon Sep 17 00:00:00 2001 From: yykani Date: Wed, 2 Jul 2025 17:42:35 +0900 Subject: [PATCH] fix: ensure upper bond does not go below zero in landmark extraction (#329) --- musetalk/utils/preprocessing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/musetalk/utils/preprocessing.py b/musetalk/utils/preprocessing.py index 1d2f024..978480c 100755 --- a/musetalk/utils/preprocessing.py +++ b/musetalk/utils/preprocessing.py @@ -118,7 +118,8 @@ def get_landmark_and_bbox(img_list,upperbondrange =0): if upperbondrange != 0: half_face_coord[1] = upperbondrange+half_face_coord[1] #手动调整 + 向下(偏29) - 向上(偏28) half_face_dist = np.max(face_land_mark[:,1]) - half_face_coord[1] - upper_bond = half_face_coord[1]-half_face_dist + min_upper_bond = 0 + upper_bond = max(min_upper_bond, half_face_coord[1] - half_face_dist) f_landmark = (np.min(face_land_mark[:, 0]),int(upper_bond),np.max(face_land_mark[:, 0]),np.max(face_land_mark[:,1])) x1, y1, x2, y2 = f_landmark