[英]Using a different face detector with dlib's landmark detector
I am currently working on a python implementation of Adrian Rosebrock's video blink detector with dlib blog post:我目前正在使用 dlib 博客文章对 Adrian Rosebrock 的视频闪烁检测器进行 Python 实现:
https://www.pyimagesearch.com/author/adrian/ https://www.pyimagesearch.com/author/adrian/
Basically, I am using dlib's frontal face detector and passing the bounding box around the face to dlib's landmark detector as seen in this picture:基本上,我正在使用 dlib 的正面人脸检测器并将面部周围的边界框传递给 dlib 的地标检测器,如下图所示:
https://imgur.com/xvkfNeG https://imgur.com/xvkfNeG
Sometimes dlib's frontal face detector doesn't find a face, but other face detectors like OpenCV's do.有时 dlib 的正面人脸检测器找不到人脸,但其他像 OpenCV 的人脸检测器可以。 Adrian's blog made it sound like I could use openCV's frontal face detector and pass the bounding box along instead.
Adrian 的博客听起来像是我可以使用 openCV 的正面检测器并传递边界框。
However when I do this the landmark detector can't find the eyes of the person correctly as seen in this photo:但是,当我这样做时,地标检测器无法正确找到人的眼睛,如这张照片所示:
https://imgur.com/3eAFFsQ https://imgur.com/3eAFFsQ
Is there way I could use an alternative face detector with dlib's landmark detector?有没有办法在 dlib 的地标检测器中使用替代人脸检测器? Or am I stuck using dlib's frontal face detector because the bounding box passed by a different face detector will be ever so slightly incorrect for the dlib landmark detector?
还是我一直在使用 dlib 的正面人脸检测器,因为不同人脸检测器通过的边界框对于 dlib 地标检测器来说会有点不正确?
Thank you for your time!感谢您的时间!
Checking the images you are providing it just look like you are not passing the correct parameters to the plotting method.检查您提供的图像看起来就像您没有将正确的参数传递给绘图方法。 The results look correct, just upside-down.
结果看起来是正确的,只是颠倒了。
You can use your own face detector.您可以使用自己的面部检测器。 You just have to use
dlib.rectangle()
function.你只需要使用
dlib.rectangle()
函数。 First, find the bounding boxes from your face detector and after that map them to dlib.rectangle(x,y,w,h)
.首先,从人脸检测器中找到边界框,然后将它们映射到
dlib.rectangle(x,y,w,h)
。
Then you can pass the bounding boxes from this list to predictor(img, rect)
.然后,您可以将此列表中的边界框传递给
predictor(img, rect)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.