FIX 修复面部提取边界问题

This commit is contained in:
康宇佳 2025-02-20 16:23:08 +08:00
parent f00e51b152
commit 4de4ad938b
1 changed files with 2 additions and 2 deletions

View File

@ -149,8 +149,8 @@ class FaceExtract:
for b, b1 in zip( for b, b1 in zip(
list(range(int(y1), int(y2))), list(range(face_size)) list(range(int(y1), int(y2))), list(range(face_size))
): ):
if (a >= 0 and a <= r.orig_img.shape[1]) and ( if (a >= 0 and a < r.orig_img.shape[0]) and (
b >= 0 and b <= r.orig_img.shape[0] b >= 0 and b < r.orig_img.shape[1]
): ):
template[a1][b1] = r.orig_img[a][b] template[a1][b1] = r.orig_img[a][b]
print(int(x1), int(x2), int(y1), int(y2)) print(int(x1), int(x2), int(y1), int(y2))