feat 新增人脸识别 中心点检测

This commit is contained in:
zchen
2024-04-26 15:37:16 +08:00
parent 27d96a80b9
commit 0c2cf1ec02
2 changed files with 14 additions and 8 deletions

View File

@@ -85,17 +85,17 @@ class GenerateImage:
image_result = cv2.cvtColor(np.squeeze(image.astype(np.uint8)), cv2.COLOR_RGB2BGR)
is_smudge = True
if self.category == "sketch":
# 色阶调整
cutoff = 1
levels_img = autoLevels(image_result, cutoff)
# 亮度调整
luminance = luminance_adjust(0.3, levels_img)
# 去背景
remove_bg_image = remove_background(luminance)
# 人脸检测
if face_detect_pic(image_result) > 0:
if face_detect_pic(remove_bg_image) > 0:
is_smudge = False
else:
# 色阶调整
cutoff = 1
levels_img = autoLevels(image_result, cutoff)
# 亮度调整
luminance = luminance_adjust(0.3, levels_img)
# 去背景
remove_bg_image = remove_background(luminance)
# 污点/
is_smudge, not_smudge_image = stain_detection(remove_bg_image)
# 类型识别