Comments (3)
Yes that code it is pretty similar to the one I have implemented. I think the guy took inspiration from Deepgaze to create that blog post. I think that MTCNN may be a good choice. Good luck with your experiments!
from deepgaze.
Anyways, I would not mind trying this out on my project and supplying the scripts and videos if you can add me as a minor contributor.
You are welcome to contribute. If you think you can provide an additional feature or do some useful tests then do it! Based on the contribution we will decide if adding you as major or minor contributor.
Yes the bottleneck is the face detector. The OpenCV Haar cascade can recognize front and profile faces. A slight rotation on the vertical axis is also allowed.
There are a few parameters in the method returnFacePosition()
that you can manage in Deepgaze to allocate more resources to tilted and scaled faces. Give a look at this method (also reported below).
For instance if you change the value of rotationAngleCCW
and rotationAngleCW
the detector will look for faces at different degrees. Changing minSizeX
you can allow the detector to look for smaller faces.
The problem is that since the detector is called multiple times, the method starts to be slow and it is difficult to guarantee real-time. We were working on something faster based on Deep Learning, but the feature has never been finished.
Directly from the description of the method:
def returnFacePosition(self, inputImg,
runFrontal=True, runFrontalRotated=True,
runLeft=True, runRight=True,
frontalScaleFactor=1.1, rotatedFrontalScaleFactor=1.1,
leftScaleFactor=1.1, rightScaleFactor=1.1,
minSizeX=30, minSizeY=30,
rotationAngleCCW=30, rotationAngleCW=-30,
lastFaceType=0):
"""Find a face (frontal or profile) in the input image
Find a face and return the position. To find the right profile the input
image is vertically flipped, this is done because the training
file for profile faces was trained only on left profile. When all the
classifiers are working the computation can be slow. To solve the problem
it is possible to accurately tune the minSize and ScaleFactor parameters.
@param inputImg the image where the cascade will be called
@param runFrontal if True it looks for frontal faces
@param runFrontalRotated if True it looks for frontal rotated faces
@param runLeft if True it looks for left profile faces
@param runRight if True it looks for right profile faces
@param frontalScaleFactor=1.1
@param rotatedFrontalScaleFactor=1.1
@param leftScaleFactor=1.1
@param rightScaleFactor=1.1
@param minSizeX=30
@param minSizeY=30
@param rotationAngleCCW (positive) angle for rotated face detector
@param rotationAngleCW (negative) angle for rotated face detector
@param lastFaceType to speed up the chain of classifier
Return code for face_type variable: 1=Frontal, 2=FrontRotLeft,
3=FronRotRight, 4=ProfileLeft, 5=ProfileRight.
"""
from deepgaze.
@mpatacchiola
I'll definitely try replacing the Haar face detector with MTCNN, Tencent DFSD (this one is good but very slow as you mentioned it rotates, resizes and calls detect() multiple times) but I know with MTCNN, it did not detect a frontal face lying sideways without rotate so it's probably going to be slow as well.
Thank you for all the info above. By the way though, I am just learning PnP and found this: https://www.learnopencv.com/head-pose-estimation-using-opencv-and-dlib/ but are the fundamentals behind your implementation similar?
from deepgaze.
Related Issues (20)
- difficulties installing HOT 3
- Check for OpenCV 2, 3 and 4 HOT 1
- contours, hierarchy = cv2.findContours(mask, 1, 2) ValueError: too many values to unpack (expected 2) HOT 2
- import cv doesn't work in both version HOT 6
- Unsupported image type, must be 8bit gray or RGB image. HOT 2
- A bit issue that i fixed for you use in opencv v3 HOT 1
- NameError: name 'x_center' is not defined HOT 3
- Freezing and optimizing the model HOT 6
- Input format for the network HOT 4
- Accuracy of deepgaze HOT 8
- Problem with tensorflow version
- Different head pose angles HOT 2
- Notebooks HOT 3
- Improvements on skin detect HOT 3
- How could I load the head pose estimator pre-trained model by checkpoint? HOT 1
- cnn_head_pose estimation: module 'tensorflow' has no attribute 'placeholder' HOT 7
- cnn_head_pose_estimation problems HOT 1
- Can I achieve the 3D head translation vector HOT 1
- Face recognition
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepgaze.