下载训练集(MS1M-Arcface)并将其放在$INSIGHTFACE_ROOT/datasets/中。
下载预训练模型(model-r100-ii)并将其放在$INSIGHTFACE_ROOT/models/中。
Verification Test.
lfw
,cfp
,agedb-30
这几项已经在训练时不断被测试了. 如果想用训好的模型测试这几项得分的话, 可以运行源码/recognition/eval/verification.py 或者是 /src/eval/verification.py。
注意:
根据你电脑的路径设置,路径的文件名最好不要有空格或者是其他的字符,否则有可能会报错。
如果使用的是python3,源码中的xrange需要改为range。并且将 /src/eval/verification.py中的185行
bins, issame_list = pickle.load(open(path, 'rb'))
修改为
try:
with open(path, 'rb') as f:
bins, issame_list = pickle.load(f) #py2
except UnicodeDecodeError as e:
with open(path, 'rb') as f:
bins, issame_list = pickle.load(f, encoding='bytes') #py3
终端下运行py文件
python verification.py --data-dir ../insightface-master/datasets/faces_emore --model ../Arcface/insightface-master/models/model-r100-ii/model,0
运行结果:
testing verification..
[21:33:51] c:\jenkins\workspace\mxnet-tag\mxnet\src\operator\nn\cudnn\./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (set the environment variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable)
(12000, 512)
infer time 80.33971900000012
[lfw]XNorm: 22.128445
[lfw]Accuracy: 0.00000+-0.00000
[lfw]Accuracy-Flip: 0.99767+-0.00281
Max of [lfw] is 0.99767
testing verification..
(14000, 512)
infer time 89.12483400000006
[cfp_ff]XNorm: 21.086574
[cfp_ff]Accuracy: 0.00000+-0.00000
[cfp_ff]Accuracy-Flip: 0.99843+-0.00162
Max of [cfp_ff] is 0.99843
testing verification..
(14000, 512)
infer time 86.81863299999996
[cfp_fp]XNorm: 21.346184
[cfp_fp]Accuracy: 0.00000+-0.00000
[cfp_fp]Accuracy-Flip: 0.98229+-0.00572
Max of [cfp_fp] is 0.98229
可以看到验证结果