the align function may Shear the face image
See original GitHub issueH = cv2.getAffineTransform(npLandmarks[npLandmarkIndices],
imgDim * MINMAX_TEMPLATE[npLandmarkIndices]*scale + imgDim*(1-scale)/2)
thumbnail = cv2.warpAffine(rgbImg, H, (imgDim, imgDim))
I got the following result:
Why not use least square? Y = MX M = (YXt)(XXt)-1
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Face Alignment with OpenCV and Python - PyImageSearch
In this tutorial you'll learn how to perform facial alignment using OpenCV, Python, and computer vision techniques.
Read more >The Math and Code Behind Aligning Faces - sabbir.dev
To rotate the image which is typically a 3-dimensional matrix, we have to transform the matrix with a rotation matrix, we may have...
Read more >The Math and Code Behind Aligning Faces | Analytics Vidhya
Facial alignment is a prerequisite to many machine learning and deep ... with a rotation matrix, we may have to shear the matrix...
Read more >Image Features and Image Alignment | Getting started with ...
In this video, we will learn about Image Features and how we can use them to align an image.❓FAQWhat is image alignment in...
Read more >Alignment by Maximization of Mutual Information 1 Introduction
As the illumination changes the functional relationship between the model and image will change. Since we can not know beforehand what the imaging...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I think this is a known problem which has been discussed for example here. To my knowledge it has not been really solved though. Have you tried this approach? Does it produce better results?
Another approach would be to not do any transformation at all but instead just use a bounding box and let the CNN handle any rotations etc within that box. Rotations can then be seen as a kind of data augumentation instead. I have tried this approach but using MTCNN for face alignment, and when training a Inception-Resnet-v1 network on this data I can get a model with accuracy ~0.975 on LFW. Not sure how much of the performance improvement that can be attributed to not having the shearing effect though.
I’m pretty sure I ran into the same problem but now I’m not sure how it was solved. Could have been that it was fixed when upgrading to a newer version of slim, but I’m not sure. One option would be to upgrade to TF 0.11 and see if that fixes the problem. I will do that as well as soon as I’m done with some training. If the problem persists, please file a new issue specifically for this.