MTCNN tensorflow achieve

Depend on the environment

You need to install opencv, numpy, tqdm

1
2
3
Python install OpenCV-PIP 
PIP install numpy
PIP install tqdm # display processing progress

Reference Code
https://github.com/LeslieZhoa/tensorflow-MTCNN

manual

  1. Manually download the data, and extract the data directory

    1. Download training data for face detection: WIDER_train

    2. Download training data for face alignment: lfw_5590 & net_7876

  2. Data preprocessing
  3. Data generated tfrecords
  4. Implementation of training

PNet training step

  1. 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:

  2. 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
  3. 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
  4. Use "python gen_tfrecords.py 12" command, generated in step 3 on the document, the extraction image, generating data tfrecord
  5. Use "python train.py 12" command, using the training data tfrecord

RNet training step

  1. 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:

  1. From the face frame label (or called coordinates) document (wider_face_train.txt) to obtain data
  2. 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
  3. Acquiring data from the face alignment labels document (trainImageList.txt), the interception of the face, the additional data variables to Step 2
  4. Using the previous step of generating class variables, to extract data from the image
  5. The coordinate variables in the normalization process
  6. The random variables upset
  7. 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/

Guess you like

Origin www.cnblogs.com/chinatrump/p/11415232.html