From 2700ad4626deb7021c251a88a5e314c464f4978e Mon Sep 17 00:00:00 2001 From: Hemerocalle <2958238716@qq.com> Date: Sat, 1 Jun 2024 01:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ data.py | 2 +- visualmodule.py | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7399920..785d18a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ __pycache__ +.gitignore .history .vscode temp ui/ui_auto.py models/test test.py +release diff --git a/data.py b/data.py index 9ccbe54..fcb4cd1 100644 --- a/data.py +++ b/data.py @@ -17,7 +17,7 @@ MODEL_EMOTION = 'models/model_emotion/fer2013_mini_XCEPTION.95-0.70.hdf5' # 载入模型数据 -CLAHE_FACE = createCLAHE(clipLimit=2.0, tileGridSize=(8, 8)) +CLAHE_FACE = createCLAHE(clipLimit=4.0, tileGridSize=(8, 8)) CLASSIFIER_FACE = CascadeClassifier(MODEL_FACE) CLASSIFIER_EMOTION = load_model(MODEL_EMOTION, compile=False) CLASSIFIER_EMOTION_SIZE = CLASSIFIER_EMOTION.input_shape[1:3] # type: ignore diff --git a/visualmodule.py b/visualmodule.py index f92d598..a881ab6 100644 --- a/visualmodule.py +++ b/visualmodule.py @@ -30,11 +30,9 @@ # 最后更新时间 2024/05/16 from math import floor -from turtle import width -from typing import Sequence from PIL import Image as PILImage, ImageDraw import cv2 -from cv2.typing import MatLike as CVImage, Rect +from cv2.typing import MatLike as CVImage from cv2 import COLOR_BGR2RGB, COLOR_RGB2BGR import numpy as np from numpy._typing import NDArray as NPImage @@ -53,7 +51,7 @@ def __init__(self, rec: 'Recognizer') -> None: # 从灰度图像中检测人脸 @classmethod - def getFace(cls, image: CVImage) -> Sequence[Rect]: + def getFace(cls, image: CVImage) -> list[tuple]: # image = cv2.GaussianBlur(image, (5, 5), 0) # 高斯模糊 # image = cv2.equalizeHist(image) # 直方图均衡化 image = CLAHE_FACE.apply(image) # 局部对比度增强