user3298970
user3298970

Reputation: 1

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

I used a library of 228 male faces and 350 female faces. Using the opencv createclassifier on my positives.txt file which contains a list of the male faces. Using the .vec file create by the classifier I used haartraining with the following command:

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.

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?

Upvotes: 0

Views: 2228

Answers (1)

Silu
Silu

Reputation: 176

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/

Upvotes: 1

Related Questions