Coder Social home page Coder Social logo

bovifocr / fas_3dfr_5thchalearn_cvpr2024 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bovifocr/3dpc-net

0.0 0.0 0.0 33.18 MB

Face Anti-Spoofing (FAS) method based on 3D Face Reconstruction

Home Page: https://insightface.ai

Shell 0.16% Python 99.84%

fas_3dfr_5thchalearn_cvpr2024's Introduction

TRAIN MODEL (BOVIFOCR)

1. Clone this repo:

git clone https://github.com/BOVIFOCR/FAS_3DFR_5thChalearn_CVPR2024.git
cd FAS_3DFR_5thChalearn_CVPR2024

2. Create conda env and install python libs:

export CONDA_ENV=fas_3dfr_5thchalearn_cvpr2024_py39
conda create -n $CONDA_ENV python=3.9
conda activate $CONDA_ENV
conda env config vars set CUDA_HOME="/usr/local/cuda-11.6"; conda deactivate; conda activate $CONDA_ENV
conda env config vars set LD_LIBRARY_PATH="$CUDA_HOME/lib64"; conda deactivate; conda activate $CONDA_ENV
conda env config vars set PATH="$CUDA_HOME:$CUDA_HOME/bin:$LD_LIBRARY_PATH:$PATH"; conda deactivate; conda activate $CONDA_ENV

conda install pytorch=1.13.0 torchvision pytorch-cuda=11.6 -c pytorch -c nvidia
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
conda install -c bottler nvidiacub
conda install pytorch3d -c pytorch3d
pip3 install -r requirements.txt

3. Reconstruct faces with the HRN method:

4. Train model:

export CUDA_VISIBLE_DEVICES=0; python train_model_5thChalearn_FAS_CVPR2024.py --config configs/UniAttackData_3d_hrn_r50.py

The trained model will be saved in the folder work_dirs.

5. Our trained models' weights:

6 Test model:

export CUDA_VISIBLE_DEVICES=0; python test_model_5thChalearn_FAS_CVPR2024.py --config configs/UniAttackData_3d_hrn_r50.py --weights /path/to/best_model_acc=99.8496_AUC_0.9996.pt --part dev --protocol /path/to/UniAttackData/phase1/p1/dev.txt --img-path /path/to/UniAttackData_align_crop/phase1

A file phase1_p1_dev.txt will be generated with the image scores:

p1/dev/000001.jpg 0.73088217
p1/dev/000002.jpg 0.7308881
p1/dev/000003.jpg 0.73088604
p1/dev/000004.jpg 0.73089004
p1/dev/000005.jpg 0.7308881
p1/dev/000006.jpg 0.7308893
...
p1/dev/005998.jpg 0.7295462
p1/dev/005999.jpg 0.729513
p1/dev/006000.jpg 0.7308867

7 Scores files:

Here are the face scores files of our best model submitted in phase1 and phase2 of the 5th Chalearn Face Anti-spoofing Workshop and Challenge@CVPR2024:

fas_3dfr_5thchalearn_cvpr2024's People

Contributors

nttstar avatar anxiangsir avatar jiankangdeng avatar biesseck avatar guoxiawang avatar wenmuzhou avatar qingpingzheng avatar yuzhenbo avatar barisgecer avatar xiaoyang-coder avatar littletomatodonkey avatar msameim181 avatar maldil avatar olojuwin avatar leondgarse avatar 007gzs avatar chenjoya avatar deftruth avatar szad670401 avatar krenax avatar shiquanyu avatar sthphoenix avatar shinkansan avatar tengerye avatar nihui avatar ppwwyyxx avatar yingfeng avatar sagarbhathwar avatar nlqq avatar itsnine 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.