資源簡(jiǎn)介
基于python3.0實(shí)現(xiàn)人臉特征的提取,提取獲取到的人臉圖像的特征
代碼片段和文件信息
#coding=utf-8
“““
Author:wepon
Code:https://github.com/wepe
File:?get_feature_map.py
1.??visualize?feature?map?of?Convolution?layer?Fully?Connected?layer
2.??rewrite?the?code?so?you?can?treat?CNN?as?feature?extractor?see?file:?cnn-svm.py
--
2016.06.06更新:
keras的API已經(jīng)發(fā)生變化,現(xiàn)在可視化特征圖可以直接調(diào)用接口,具體請(qǐng)參考:http://keras.io/visualization/
“““
from?__future__?import?print_function
import?pickletheano
import?matplotlib.pyplot?as?plt
import?matplotlib.cm?as?cm
import?cv2
import?sys
import?gc
from?face_train_use_keras?import?Model
#load?the?saved?model
model?=?Model()
model.load_model(file_path=‘F:/wget/FaceDetectionAndRecognition-master/me.face.model.h5‘)
#define?theano?funtion?to?get?output?of??FC?layer
get_feature?=?theano.funct
評(píng)論
共有 條評(píng)論