SoftwareGift / FeatherNets_Face-Anti-spoofing-Attack-Detection-Challenge-CVPR2019

Code for 3rd Place Solution in Face Anti-spoofing Attack Detection Challenge @ CVPR2019,model only 0.35M!!! 1.88ms(CPU)
Other
928 stars 282 forks source link

如何从feature vector计算score #47

Open edwardpwtsoi opened 5 years ago

edwardpwtsoi commented 5 years ago

请问能描述一下怎么样从FeatherNet的输出向量(长度1024的)计算出score吗?

SoftwareGift commented 5 years ago

请问能描述一下怎么样从FeatherNet的输出向量(长度1024的)计算出score吗?

参考测试的代码

edwardpwtsoi commented 5 years ago

_, pred = output.topk(maxk, 1, True, True) line 393 main.py 这一部分是不是出了错?topk的第二个return是indices 假如我继续运行 python main.py --config="cfgs/FeatherNetB-32.yaml" --resume ./our_pretrained_models/FeatherNetB_bs32/_47_best.pth.tar --val True --val-save True 我会得到这个报错 Traceback (most recent call last): File "main.py", line 405, in main() File "main.py", line 194, in main validate(val_loader, model, criterion,args.start_epoch) File "main.py", line 333, in validate tn, fp, fn, tp = confusion_matrix(label_list, predicted_list).ravel() ValueError: too many values to unpack (expected 4)

用breakpoint()调查了一下发现 correct = pred.eq(target.view(1, -1).expand_as(pred)) line394 main.py 这部分在比较label跟indices

hhyhcr449 commented 5 years ago

思路上没有错。indices也是从0开始,对应了标签的0,1