lgsc-for-fas-pytorch
lgsc-for-fas-pytorch copied to clipboard
Learning Generalized Spoof Cues for FaceAnti-spoofing reimplementation in pytorch
LGSC-for-FAS pytorch
WORK IN PROGRESS
This repository is reimplementation of "LGSC-for-FAS" repository, which is implementation of "Learning Generalized Spoof Cues for FaceAnti-spoofing (LGSC)"
Code of this repository uses "pytorch" and "pytorch_lightning"
Train
There are 2 ways:
- Configure your own dataset, redefine
val_dataloader&train_dataloaderfunctions inpl_model.py - Specify in
configs/train_config.ymlnext variables:train_df- path to csv with train info. Each object should havetarget(1 for live, 0 for spoof) andpath(relative path, seesrc/datasetto understand, how path is build), Also specifyval_df(liketrain_df),path_root(absolute path to your data) anddefault_root_dir(path to storepytorch_lightninglogs)
Note You can crop faces online with facenet-pytorch,
just specify parameters in configs/train_config.yml
Then run python src/train.py -c configs/train_config
Infer
- Specify parameters in
configs/infer_configs.yml - Run
src/infer.py
Citation
@inproceedings{
feng2020deep,
title={Learning Generalized Spoof Cues for Face Anti-spoofing},
author={Haocheng Feng and Zhibin Hong and Haixiao Yue and Yang Chen and Keyao Wang and
Junyu Han and Jingtuo Liu and Errui Ding},
year={2020},
eprint={2005.03922},
archivePrefix={arXiv},
primaryClass={cs.CV}
}