Giter Club home page Giter Club logo

iccv-2021-anti-spoofing's Introduction

pkg文件夹中有anaconda的安装包

conda环境搭建

conda create -n anti python=3.7

conda activate anti

pip install -r requirements.txt

安装Ranger优化器

git clone https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer
cd Ranger-Deep-Learning-Optimizer
pip install -e .

拉取数据

图片数据解压后放置于raw_data文件夹内

预处理

通过retinanet r50,完成人脸检测,检测结果是 extra_data/pts_v2.tar
基本思路为,设置[0.8 0.1 0.001]三个阈值档位,依次进行检测,在0.1及以上档位检出的标签给到2,在0.1-0.001之间输出的标签给到1,0.001仍为检到脸给0 通过该处理,完成色块图像,以及极端光照图像的简单划分,以及困难人脸的检出

首次训练

cd extra_data
tar -xvf pts_v2.tar
cd ../anti_code
python3 train_ccl.py --config_file="configs/ccl_mask.yml"

获取最佳valid的结果,以及模型文件model_1

使用该模型预测二阶段数据,获取初始伪标签 python3 test_TTA.py --config_file="configs/ccl_mask.yml" 得到标签为temp_res_test.txt

后处理

调用后处理程序完成结果平滑
cd ./post_process
python3 post_process.py

运行前,需要更改代码中的读取路径(需要改为训练模型 TTA 预测的结果)以及结果生成路径。结果即为最终的推理结果。 考虑到valid和test上存在分布偏差,为EER求出的阈值过偏,导致结果偏移严重,因此直接采取0.5-0.7之间的数值作为阈值。根据此前train_ccl产生的最佳模型在validset上产生的结果及赛方提供的valid标签,计算最佳阈值点,并划分出真假结果。随后将neg设为thred-0.1,pos设为thred+0.1,作为前置结果合并提交

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.