insightface模型测试

下载训练集(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

可以看到验证结果

 

 
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值