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 284 forks source link

请问大佬,训练验证精度都很好,但单独用测试集测试效果却很差,是什么原因了 #78

Open Galaxy-yyyyy opened 4 years ago

SoftwareGift commented 4 years ago

测试的代码是我写的这个吗,还是其他的平台上进行测试。如果是我写的那个应该是不会这种情况。 你没有说具体的问题,不是很好回答。

Galaxy-yyyyy commented 4 years ago

python main.py --config="cfgs/mobilenetv2.yaml" --resume ./checkpoints/mobilenetv2_bs32/_4_best.pth.tar --phase-test True --val True --val-save True 用的这个,直接在main.py里面修改,然后测试。 用的是整脸进行训练,训练时,训练集和验证集的精度都可以达到99%以上,而测试的时候,精度只有50%左右。

Galaxy-yyyyy commented 4 years ago

@SoftwareGift 训练的是深度图

huangyuyu0426 commented 4 years ago

请问你们训练时的数据集怎么得到的?下不到

boom9807 commented 4 years ago

我也遇到了同样的问题,用作者预训练的模型直接在测试集上测试得到ACER达到了0.505,请问您解决了这个问题吗

image

riskeverything commented 3 years ago

我也遇到了同样的问题,用作者预训练的模型直接在测试集上测试得到ACER达到了0.505,请问您解决了这个问题吗

image

你这肯定是数据不对,用了rgb。

luoyuncen commented 3 years ago

这个是因为原始下载的代码当中,对于test的标签文件,有一句代码被注掉了,采用了随机的标签值。在read_data.py文件下。 if self.phase_test:#测试阶段 depth_dir = self.depth_dir_test label_dir = self.label_dir_test label = int(label_dir[idx])

label = np.random.randint(0,2,1)

label = np.array(label)

上面这个我已经改回来了。原始代码用的是label = np.random.randint(0,2,1),这个标签是随机的。所以检测效率是0.5左右。