ternaus / datasouls_antispoof

Code and pre-trained models for detecting spoofing attacks from images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anti spoofing with the Datasouls dataset

Installation

pip install -U datasouls_antispoof

Example inference

Colab notebook with the example: Open In Colab

Dataset

ID & RD anti spoofing challenge

Four types of images:

  • real
  • replay
  • printed
  • mask2d

Training

Define the config.

Example at datasoluls_antispoof/configs

Define the environmental variable IMAGE_PATH that points to the folder with the dataset.

Example:

export IMAGE_PATH=<path to the folder with images>

Inference

python -m torch.distributed.launch --nproc_per_node=<num_gpu> datasouls_antispoof/inference.py \
                                   -i <path to images> \
                                   -c <path to config> \
                                   -w <path to weights> \
                                   -o <output-path> \
                                   --fp16

Pre-trained models

Models Validation accuracy Config file Weights
swsl_resnext50_32x4d 0.9673 Link Link
tf_efficientnet_b3_ns 0.9927 Link Link

About

Code and pre-trained models for detecting spoofing attacks from images.

License:Apache License 2.0


Languages

Language:Python 100.0%