人脸检测库:libfacedetection
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了人脸检测库:libfacedetection相关的知识,希望对你有一定的参考价值。
参考技术A 这是一个基于cnn的图像人脸检测的开源库。CNN模型已被转换为C源文件中的静态变量。源代码不依赖于任何其他库。你所需要的只是一个c++编译器。您可以使用c++编译器在Windows、Linux、ARM和任何平台下编译源代码。SIMD指令用于加速检测。如果您使用Intel CPU或NEON for ARM,则可以启用AVX2。在目录中还提供了模型文件models/examples/libfacedetectcn -example.cpp展示了如何使用这个库。使用g++编译源代码时,请添加-03以启用优化。
使用Microsoft Visual Studio编译源代码时,请选择“最大化速度/-02”。
1.设置AArch64交叉编译器(请参考AArch64工具链.cmake)
2.设置OpenCV路径,因为示例代码依赖于OpenCV
OpenCV Haar+AdaBoost以最小的面尺寸48x48运行
只检测人脸,不包含地区检测。
最小面尺寸~12x12
Intel(R) Core(TM) i7-7700 CPU @ 3.6GHz
只检测人脸,不包含地区检测。
最小面尺寸~12x12
Raspberry Pi 3B+, 博通 BCM2837BO, Cortex-A53 (ARMv8) 64位SoC @ 1.4GHz
Shiqi Yu, shiqi.yu@gmail.com
本研究由深圳市科学基金(批准号:JCYJ20150324141711699)。
使用 yolov4 人脸检测和 face_recognition
【中文标题】使用 yolov4 人脸检测和 face_recognition【英文标题】:use yolov4 face detection with face_recognition 【发布时间】:2021-02-15 06:13:26 【问题描述】:是否可以使用yolov4进行物体检测并使用face_recognition库识别检测到的人脸,还是需要使用face_recognition库提供的人脸检测才能使用其人脸识别?
【问题讨论】:
【参考方案1】:face_recognition 库使用dlib
的特定于面部检测的内置算法。它声称的准确率是 99%+。您不能将该算法更改为 YoloV4 或任何其他算法。
face_recognition 的网络架构基于 ResNet-34,但层数更少,过滤器数量减少了一半。该网络在野外标签人脸 (LFW) 数据集上的 300 万张图像数据集上进行了训练。
查看 Davis King(dlib 的创建者)和 Adam Geitgey(face_recognition 的作者)关于基于深度学习的面部识别如何工作的文章:
High Quality Face Recognition with Deep Metric Learning
Modern Face Recognition with Deep Learning
但是,如果这对您的情况来说还不够,您可以训练 YoloV4 检测人脸,然后在检测后裁剪该人脸并将其作为 face_recognition 库的输入。
import face_recognition
picture_of_me = face_recognition.load_image_file("me.jpg")
my_face_encoding = face_recognition.face_encodings(picture_of_me)[0]
# my_face_encoding now contains a universal 'encoding' of my facial features that can be compared to any other picture of a face!
unknown_picture = face_recognition.load_image_file("unknown.jpg")
unknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0]
# Now we can see the two face encodings are of the same person with `compare_faces`!
results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)
if results[0] == True:
print("It's a picture of me!")
else:
print("It's not a picture of me!")
【讨论】:
以上是关于人脸检测库:libfacedetection的主要内容,如果未能解决你的问题,请参考以下文章