liamxu / Gender-Classification

Gabor + PCA + SVM, classify gender of Asian people

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

face-master

Aug 2016

Project for COMP7502
Gender Classification

Group 23: LIN Zhen, XU Linxiao, ZHU Yilei

dependency

opencv 2.4.9
boost 1.60.0

MacOS:
brew install opencv boost

ubuntu:
apt-get install opencv boost

build

cd face-master
cd src
rm CMakeCache.txt (if any)

cmake .
make

run

training program

usage: ./train /path/to/test/folder [det]

train folder must have 2 subdir: female and male

e.g.
./train trainSet ----------- # will look for folder: trainSet_output, if exists,then will not do face-detection again
./train trainSet det ------- # force re-do face-detection

test program

usage: ./test /path/to/test/file/or/folder [cal]

test folder for calulation must have 2 subdir: female and male

e.g.
./test testpic/1.jpg ------ # output gender result only
./test testSet cal -------- # output calssfication precision

Result and video demo

Result:
both female and male recognition precesion up to 79%

Demo:
https://www.youtube.com/watch?v=aWE7YZFow1o&feature=youtu.be

file list

files under first level

README.md ------------------------# current file
haarcascade_frontalface_alt.xml - # face detection from opencv 2.4.9

src/ ---------------------------- # all source file
trainSet/ ----------------------- # training set, including female and male pics
testPic/ ------------------------ # test picutres
testSet/ ------------------------ # test set for precision evaluation

ignore/ ------------------------- # reference file and scripts, can ignore

source files under src/

CMakeLists.txt ------------------ # cmake file

trMain.cpp ---------------------- # entry point for training
testMain.cpp -------------------- # entry point for test

myGabor.h ----------------------- # OUR own feature extraction algorithm
myGabor.cpp

pcaImpl.h ----------------------- # OUR own PCA algorithm
pcaImpl.cpp

utils.h ------------------------- # shared by trMain and testMain
utils.cpp

About

Gabor + PCA + SVM, classify gender of Asian people


Languages

Language:C++ 96.2%Language:CMake 2.8%Language:Shell 1.1%