-It is possible to use in mobile/web application library dlib in order that it works in real time ? I am not familar with optimization settings and so on, that is why it is interesting how much restrictions there are.
-It is possible to use in my computer without optimisation SSE4 in order that it works in real time ?
人脸特征检测有两个步骤:人脸检测和人脸特征检测。而最消耗CPU的部分是第一步——检测人脸(运行simple_object_detector),只有这部分有使用AVX/SSE的好处
为什么它很慢 - 人脸检测从 80x80 像素或更大的人脸尺寸被耗尽,如果你将一些高分辨率图像放入检测器,它将花费大量时间在不同比例的滑动窗口上。大多数情况下需要在同一帧上放置 1-3 张人脸,而现代移动相机的分辨率相当高。
因此,我建议您减小用于人脸检测的图像尺寸 - 将其缩小并按某个感兴趣区域进行裁剪。这将使您最大程度地优化性能。
下一个可能的步骤是使人脸检测器不以不同的规模运行,但可能会进行 1-2 次迭代。看看这个问题 - 它描述了这个问题 (dlib's scan_fhog_pyramid : set max_pyramid_levels)
-This file shape_predictor_68_face_landmarks.dat weights 95 Mb. I need just face+landmark detection, does this file contain redundant information according to my needs?
此文件仅包含在 iBug 数据集上训练的 68 个面部特征的数据模型。它内部没有人脸检测模型。人脸检测模型包含在 dlib/image_processing/frontal_face_detector.h 文件中
是的,这个文件很大,但这是其质量的代价。您可以训练一些新的面部标志检测模型(在http://dlib.net/train_shape_predictor_ex.cpp.html 示例中描述),但标志点更少或质量更低 - 这可以使您的文件更小
-One algorithm question...
要回答这个问题 - 请考虑阅读原文 (http://www.cv-foundation.org/openaccess/content_cvpr_2014/papers/Kazemi_One_Millisecond_Face_2014_CVPR_paper.pdf) 和 dlib/image_processing/shape_predictor.h 源代码
很快 - 在检测到人脸(找到边界框)后,形状预测器会在预先训练的位置相对于人脸边界框搜索一些特征(图像像素值)。根据特征值 shape_predictor 将 平均人脸形状 更改为新的人脸形状(预测的人脸形状),并且对于形状预测器模型内的每个训练的回归树迭代地进行此过程