Tensorflow implementation of MobileFaceNet
- tensorflow >= r1.5
- opencv-python 3.x
- python 3.x
- scipy
- sklearn
- numpy
- mxnet
- pickle
Download the MS1M-refine-v2 datasets here
Run python utils/data_process.py
Run python train_nets.py
and there are some flags you can use:
--max_epoch
to set the maximum number of epoch, default is 12
--class_number
the number of calsses, if you use MS1M-V2 you need to set the class_number
to 85742
--embedding_size
the embedding size, default of MobileFaceNet is 128
--weight_decay
weight decay of the optimizer, default is 5e-5
--train_batch_size
batch size for the training, default is 90
--tfrecords_file_path
path to MS1M-V2 tfrecord (generated by data_process.py
)
--optimizer
the optimizer for training, default is ADAM
--loss_type
the loss type, there are insightface loss, cosineface loss, and combine loss. Default is insightface
--margin_m
insightface loss, cosineface loss, or combine loss margin. Default is 0.5
Run python test_nets.py
and you need to use these flags:
--model
Could be either a directory containing the meta_file and ckpt_file or a model protobuf (.pb) file
--eval_db_path
Data test base path (consisting of lfw.bin, cfp_ff.bin, cfp_fp.bin, and agedb_30.bin files