Module 3
Assignment
Table of Contents
Train custom Facial Landmark
Detector model 2
Improve Facial Landmarks
Stabilization 3
Use OpenCV’s face detector 3
Assignment 3-1
1. Train custom Facial
Landmark Detector model
Train a facial landmark
detector model with 21 points or with any number of points you desire.
Example output for 21-points facial landmark detector model.
I don’t want to be original, so I will do it exactly as they asked, and in
the same position.
Procedure:
I will read _bv70.txt files as input, pick then 21 landmarks and save them
as _bv21.txt, one file for each image.
I modified the code generate33Points.py and save it as generate21Points.py.
This program outputs two files sets in the directory facial_landmark_data>datasets>afw
Aaaa_bv21.txt
……………………..
Yyyy_bv21.txt
Each one has 42 numbers for 21 coordinates of 21 landmarks.
I run python drawRectLandmarks.py d:\cv4faces\facial_landmark_data\ 21
With that I revised image output
files “original”, “mirror”
I run python createTrainTextXml.py d:\cv4faces\facial_landmark_data\ 21
I run python trainFLD.py d:\cv4faces\facial_landmark_data\ 21
It run for 50 minutes and output on the consola
Training accuracy: 8.2868806
Testing accuracy: 11.15939011140127
And the file shape_predictor_21_face_landmarks.dat
I got these images with the program facialLandmarkDetector.cpp modified.
21 landmarks on Hillary-Clinton and 21 landmarks on Clinton-Hillary.
21 landmarks on Donald-Trump and 21 landmarks on Trump-Donald.
2. Improve Facial Landmarks
Stabilization
Try to improve the code on
facial landmark stabilization. Can you make the landmarks more stable?
Hint : Some landmarks are more unstable than others. Can we
treat them differently?
3. Use OpenCV’s face detector
Use OpenCV instead of Dlib for
face detection and pass this as an input to facial landmark detection. Do you
see a difference in accuracy and performance of face detection + landmark detection
code?
The rectangles of the faces
detected are different in size and in the position output from the face detector of Dlib, and the OpenCV face detectors Haar and Lbp.
Dlib seems to be more precise, in
the family photo I got “false positives” for Haar and Lbp. In the boy
photo I got “false positives” with Lbp.
I detected small differences
in position of landmarks in some images, as they depend on the rectangle passed
to Dlib. (for example in Hillary lips).
Next week more on this course.
No hay comentarios:
Publicar un comentario