Code Monkey home page Code Monkey logo

casia-surf_cefa's Introduction

Chalearn CeFA Face Anti-Spoofing challenge

This is code of our solution for Chalearn Single-modal face anti spofing attack detection challenge at CVPR 2020.

Please if you use this code in your experiments, site the following paper: https://arxiv.org/abs/2006.16028

Our solution based on two types of artificial transforms: rank pooling[1] and optical flow[2], combined in end-to-end pipeline for spoof detection with sequence augmentation to enrich the collection of fake tracks.

Alt text

References

[1] Basura Fernando, Efstratios Gavves, Jose Oramas, AmirGhodrati, and Tinne Tuytelaars.Rank pooling for actionrecognition.TPAMI, 39(4):773โ€“787, 201

[2] C. Liu. Beyond pixels: Exploring new representations and applications for motion analysis. Doctoral Thesis. MIT, 2009.

Training steps

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
pip install cython
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_protocol_4_1/rgb_track_exp1_protocol_4_1.config;
CUDA_VISIBLE_DEVICES=0 python main.py --config experiments/rgb_track/exp1_protocol_4_2/rgb_track_exp1_protocol_4_2.config;
CUDA_VISIBLE_DEVICES=0 python main.py --config experiments/rgb_track/exp1_protocol_4_3/rgb_track_exp1_protocol_4_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_protocol_4_1/rgb_track_exp1_protocol_4_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_protocol_4_2/rgb_track_exp1_protocol_4_2.config \
 --checkpoint_path experiments/rgb_track/exp1_protocol_4_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_protocol_4_3/rgb_track_exp1_protocol_4_3.config \
 --checkpoint_path experiments/rgb_track/exp1_protocol_4_3/checkpoints/model_4.pth

Step 6

Compile submit_file

python compile_submit_file.py

casia-surf_cefa's People

Contributors

oleggrinch avatar alexanderparkin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.