dlib face detection failing to catch - python

Ive been exploring dlib's face detector over its python API. On most images in my data set it seems to perform slightly better than cv2 on most images so I kept playing around with it on multiple faces in picture scenarios.
Going through dlib's python examples it seems like it would be possible to train these images but I am wondering if anyone has a suggestion how to make sure that the two faces on the far left and right are detected out of the box?
This is he image that I am having trouble finding all 6 faces on (https://images2.onionstatic.com/onionstudios/6215/original/600.jpg)

Dlib has a very precise face detector. But it works bad detecting not frontal (like far left) and/or occluded faces (like far right).
Seeta (https://github.com/seetaface/SeetaFaceEngine) works better with those. But it's less precise.
Also I tried retraining Dlib's face detector. And obtained much lower precise than DLIB and less recall than Seeta. So, re-training DLIB seems not perfect idea.

In my experience, Dlib does not do very well out of the box with obscured and profile faces out of the box. I would recommend training Dlib with more data of this kind.

Related

OpenCV, python - detect and removing objects / buildings in an image

I am new to python and opencv. I am analysing images of clouds, and I need to remove the buildings, so that the subsequent analysis will have less noise. I tried using Canny edge detection and then fill in the contours, but did not get too far. I also tried thresholding by pixel colours, but cannot reliably exclude just the buildings and not other parts of the image containing the clouds.
Is there a way I can efficiently and accurately remove the buildings and keep all of the clouds/sky? Thanks for the tips in advance.
You could use a computer vision model that finds the buildings. There may be some open source ones out there. The only one I can think of at the moment is this semantic segmentation model. There should be details on how to implement it, but there could definitely be others out there.
https://github.com/CSAILVision/semantic-segmentation-pytorch
I think one of the classes is buildings and you could theoretically run the model and get the dimensions of the building and take it out.

is possible to face recognition with mediapipe in python

I try to make app with python to be able recognition face, recently use cv2+dlib and face_recognition module for recognition, but i have two problems:
have 3 or 4 second delay
low accuracy
That's why I decided to use another library, after so many search, find MediaPipe, this library is very fast (real time) and find this example for face detection, but I need face recognition! but not found any example for face recognition
Is there a solution?
Mediapipe doesn't provide a face recognition method, only face detector.
The face_recognition library has really good accuracy, It's claimed accuracy is 99%+. your dataset probably isn't good enough.
Solutions:
For better speed performance, use the "hog" model instead of "cnn" model. you can modify it when you use the face_locations method like the following code line.
locations = face_recognition.face_locations(frame, model="hog")
For accuracy, use better dataset images (higher quality, a face looking straight at the camera, more pictures for the same person but usually 1-3 pictures is enough)
If you want to increase the accuracy of face recognization reduce the tolerance value to 0.4 or 0.5 and for face detection use the hog model.
face_recognition.api.compare_faces(known_face_encodings,face_encoding_to_check, tolerance=0.5)
https://face-recognition.readthedocs.io/en/latest/face_recognition.html

How to get human face feature's size in Python using face recognition?

I have face recognition model in Python which detects face and differentiates the features like eyes, nose, mouth from a face. I want to filter-out the face features (face parts) depending upon their sizes, so that I can easily get persons if they have big eyes or small eyes without displaying the whole data.
Can anyone suggest what should I use to detect facial feature's size?

Dlib face detection from low brightness image

I want to detect face from image with low brightness. I'm using dlib for detecting the face from image. But the dlib detector is detecting no face at all. I've the following code to detect faces from image.
detector=dlib.get_frontal_face_detector()
faces=detector(image)
when i try to print the length of the faces it displays zero.
Can anybody help me, what shall I do? Is there other way to detect images from low brightness images? thanks.
Dlib face detector is a very precise one. But as a cost it has low recall, especially when images are bad and/or faces are small.
Try another face detector, like
Seeta https://github.com/seetaface/SeetaFaceEngine
Pico https://github.com/nenadmarkus/pico
or OpenCV
Those may provide detections. But false detections as well.

OpenCv Python (CTypes) detection of tilted face

I have a not-so-simple question.
The Situation:
I'm working on robust facial detection API in python written on top of OpenCV (cv not cv2).
I am using Haar Cascades for face detection specially
front - haarcascade_frontalface_default.xml
profile - haarcascade_profileface.xml
Each worker is using different harr classifier (front/profile) and produce the set of ROI (Region of Interests) then do a uion on them and merge all overlaping bouding boxes.
The result is "your casual red square" around a face with 70% accuracy and not so may phantom faces.
The problem:
Simply tilting the face. My algorithm cannot detect a tilted face.
For profile detection I did a simple flip of a image to detect both left and right profile.
I was thinking there "should" be a better way to detect a tilted face than to call algorithm multiple times for multiple slightly rotated images. (This is a only solution that came to my mind).
The question:
Is there a approach or a way or a specific harr classifier for detection of tilted faces?
Thank you :)

Categories

Resources