简体   繁体   English

性别识别课程

[英]Gender Recognition Haarcascade

I've been doing some research and attempted to build a haarcascade for identifying gender. 我一直在做一些研究,并试图建立一个识别性别的闹剧。

I read this article, which describes how they did it, which i also tried to do : http://www.ijcce.org/papers/301-E043.pdf 我阅读了这篇文章,描述了他们是如何做到的,我也尝试这样做: http : //www.ijcce.org/papers/301-E043.pdf

I used a library of 228 male faces and 350 female faces. 我使用了228张男性面孔和350张女性面孔的资料库。 Using the opencv createclassifier on my positives.txt file which contains a list of the male faces. 在我的positives.txt文件中使用opencv createclassifier,其中包含男性面孔列表。 Using the .vec file create by the classifier I used haartraining with the following command: 使用分类器创建的.vec文件,我将haartraining与以下命令结合使用:

opencv_traincascade -data classifier -vec positivies.vec -bg negatives.txt -numStages 20 -minHitRate 0.99 -maxFalseAlarmRate 0.5 -numPos 228 -numNeg 350 -w 640 -h 480 -mode ALL

After running this a few times I do not get a haar classifier.xml output file so I'm unsure whether I am doing everything correctly. 运行几次后,我没有得到haar classifier.xml输出文件,因此不确定不确定是否正确执行了所有操作。

But my question is whether it is possible using male faces as positive samples and female as negative samples to train and use a haarcascade for classifying gender? 但是我的问题是,是否有可能使用男性面孔作为阳性样本,使用女性面孔作为阴性样本来训练和使用ha级对性别进行分类?

As already said in the comments with one cascade classifier you can only detect a male/female face or no face at all. 正如使用一个级联分类器的注释中已经说过的,您只能检测到男性/女性面部或根本没有面部。

But you could just train two classifiers one for female and one for male and then run them both. 但是您可以只训练两个分类器,一个针对女性,一个针对男性,然后同时运行它们。

For the training I would recommend you to use more training examples. 对于培训,我建议您使用更多的培训示例。

I used this tutorial. 我使用了本教程。 It is for python, but can easily used for every other language, it might help you as well: https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/ 它适用于python,但可以轻松用于其他任何语言,也可能对您有帮助: https : //pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM