Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

性别识别 #56

Open
Lassi-Ki opened this issue Aug 14, 2021 · 0 comments
Open

性别识别 #56

Lassi-Ki opened this issue Aug 14, 2021 · 0 comments

Comments

@Lassi-Ki
Copy link

性别识别大部分都是识别到女生
在原本的代码下运行会报错,参照表型识别将代码更改为:

for (x, y, w, h) in faces:
    gray_face = gray[(y):(y + h), (x):(x + w)]
    gray_face = cv2.resize(gray_face, (64, 64))
    gray_face = gray_face / 255.0
    gray_face = np.expand_dims(gray_face, 0)
    gray_face = np.expand_dims(gray_face, -1)
    gender_label_arg = np.argmax(gender_classifier.predict(gray_face))
    gender = gender_labels[gender_label_arg]
    cv2.rectangle(img, (x, y), (x + h, y + w), color, 2)
    img = chineseText.cv2ImgAddText(img, gender, x + h, y, color, 30)

目前不太清楚性别识别大部分识别为女性是否跟代码更改有关联,望指教

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant