人脸识别算法测试

人脸识别算法测试

opencv 加载oOpenFace 人脸识别模型

//加载人脸检测模型
std::string modelConfiguration = "./deploy_lowres.prototxt";
std::string modelBinary = "./res10_300x300_ssd_iter_140000_fp16 .caffemodel";

//初始化网络
Net detectNet = readNetFromCaffe(modelConfiguration, modelBinary);


//加载识别模型
std::string recongnitionModel = "./openface.nn4.small2.v1.t7";
Net recoNet = readNetFromTorch(recongnitionModel);

cv::String dataBasePath="/FaceRegister/FaceRegister";
std::map<std::string,cv::Mat>  dataBaseF =  \
faceDatabaseFeature(dataBasePath,detectNet,recoNet);

其中,__deploy_lowres.prototxt__和__es10_300x300_ssd_iter_140000_fp16 .caffemodel__文件是用于检测检测人脸的工作,将检测到的人脸__faces__返回,接着用__openface.nn4.small2.v1.t7__模型将这个faces映射到为一个128维的向量,通过计算向量的相似度,即可得出比较结果

cv::Mat inputBlob 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值