Depend on the environment
You need to install opencv, numpy, tqdm
1 |
Python install OpenCV-PIP |
Reference Code
https://github.com/LeslieZhoa/tensorflow-MTCNN
manual
-
Manually download the data, and extract the data directory
-
Download training data for face detection: WIDER_train
-
Download training data for face alignment: lfw_5590 & net_7876
-
- Data preprocessing
- Data generated tfrecords
- Implementation of training
PNet training step
-
Use "python gen_12net_data.py" command, under WIDER_train picture processing to generate three kinds of images are adjusted to the size of 12x12:
- Use "python gen_landmark_aug.py 12" command, the picture & net_7876 under lfw_5590 processed to generate landmark pictures, size or scaled to 12x12, the screenshot picture face region, the production of human face alignment coordinate documents point, produce about 170,000 image
- Use "python gen_imglist_pnet.py" command, extracts data from the four kinds of scaled data (data 1 ratio at the third step is 1: 3: 1, two kinds of data to take full step), to generate a new coordinate document
- Use "python gen_tfrecords.py 12" command, generated in step 3 on the document, the extraction image, generating data tfrecord
- Use "python train.py 12" command, using the training data tfrecord
RNet training step
- Use "python gen_hard_example.py 12" command,
The new method PNnet tfrecord document production
The default method will generate a lot of intermediate documents, resulting in a large number of IO operations, generate documentation is very slow, so the design of a new method:
- From the face frame label (or called coordinates) document (wider_face_train.txt) to obtain data
- Using a random method, the sample generates a positive, negative samples, three kinds of samples of a partial face data samples, in the form of a variable stored in memory
- Acquiring data from the face alignment labels document (trainImageList.txt), the interception of the face, the additional data variables to Step 2
- Using the previous step of generating class variables, to extract data from the image
- The coordinate variables in the normalization process
- The random variables upset
-
The data variables turn into tfrecord format, stored documents
Face Dataset
https://github.com/polarisZhao/awesome-face
Original link large column https://www.dazhuanlan.com/2019/08/26/5d6349fbd6b74/