import algorithm.extra_feature_lbp as extra_feature_lbp
import algorithm.classify_random as classify_random
import algorithm.lower_dimen_pca as lower_dimen_pca
import time

startTime = time.time()

# 用LBP方法进行特征预处理
extra_feature_lbp.run(method_generateFaceRS='lbp')

# 读取LBP特征处理的结果,并用PCA方法进行特征降维
lower_dimen_pca.run(method_readFaceRS='lbp',
                    method_generateUpdateFaceRS='lbp_pca',
                    n_components=99)

# 用RandomForest进行分类
classify_random.run(method_readFaceRS='lbp_pca')

endTime = time.time()

print('\nLBP_PCA_Random costs %.2f seconds.' % (endTime - startTime))
Esempio n. 2
0
import algorithm.extra_feature_hog as extra_feature_hog
import algorithm.lower_dimen_pca as lower_dimen_pca
import algorithm.classify_svm as classify_svm
import time

startTime = time.time()

# 用HOG方法进行特征预处理
extra_feature_hog.run(method_generateFaceRS='hog')

# 读取HOG特征处理的结果,并用PCA方法进行特征降维
lower_dimen_pca.run(method_readFaceRS='hog', method_generateUpdateFaceRS='hog_pca')

# 采用SVM进行分类,输出HOG_PCA_SVM犯错矩阵
classify_svm.run(method_readFaceRS='hog_pca')

endTime = time.time()

print('\nHOG_PCA_SVM costs %.2f seconds.' % (endTime - startTime))