/CASIA-SURF_CeFA

Face Anti-spoofing Attack Detection Challenge@CVPR2020

Primary LanguagePythonMIT LicenseMIT

Chalearn CeFA Face Anti-Spoofing challenge

Step 1.

Install at_learner_core

cd /path/to/new/pip/environment
python -m venv casia_cefa
source casia_cefa/bin/activate
pip install -e /path/to/at_learner_core/repository/

Step 2.

Put pyflow to at_learner_core/utils, replace OpticalFlow.cpp to remove logs spamming to console and build Original github repository: https://github.com/pathak22/pyflow

cd at_learner_core/at_learner_core/utils
git clone https://github.com/pathak22/pyflow.git
cd pyflow/
cp ../../../data/OpticalFlow.cpp src/OpticalFlow.cpp #Remove logs spamming to console
python setup.py build_ext -i
python demo.py # 

Please see installation instructions there.

Step 3.

Train, dev lists creating. Replace root path to images in train_list.txt, dev_list.txt, dev_test_list.txt

cd data
python prepare_lists.py --data_path /path/to/casia/surf/cefa/directory
cd ..

Step 4.

cd ../rgb_track
python configs_final_exp.py
CUDA_VISIBLE_DEVICES=0 python main.py --config experiments/rgb_track/exp1_protocol4_1/rgb_track_exp1_protocol4_1.config;
CUDA_VISIBLE_DEVICES=0 python main.py --config experiments/rgb_track/exp1_protocol4_2/rgb_track_exp1_protocol4_2.config;
CUDA_VISIBLE_DEVICES=0 python main.py --config experiments/rgb_track/exp1_protocol4_3/rgb_track_exp1_protocol4_3.config

Step 5

After training process run rgb_predictor

python test_config.py
CUDA_VISIBLE_DEVICES=0 python rgb_predictor.py --test_config experiment_tests/protocol_4_1/protocol_4_1.config \
 --model_config_path experiments/rgb_track/exp1_protocol4_1/rgb_track_exp1_protocol4_1.config \
 --checkpoint_path experiments/rgb_track/exp1_protocol4_1/checkpoints/model_4.pth
CUDA_VISIBLE_DEVICES=0 python rgb_predictor.py --test_config experiment_tests/protocol_4_2/protocol_4_2.config \
 --model_config_path experiments/rgb_track/exp1_protocol4_2/rgb_track_exp1_protocol4_2.config \
 --checkpoint_path experiments/rgb_track/exp1_protocol4_2/checkpoints/model_4.pth
CUDA_VISIBLE_DEVICES=0 python rgb_predictor.py --test_config experiment_tests/protocol_4_3/protocol_4_3.config \
 --model_config_path experiments/rgb_track/exp1_protocol4_3/rgb_track_exp1_protocol4_3.config \
 --checkpoint_path experiments/rgb_track/exp1_protocol4_3/checkpoints/model_4.pth

Step 6

Compile submit_file

python compile_submit_file.py