An open API service indexing awesome lists of open source software.

https://github.com/ternaus/datasouls_antispoof

Code and pre-trained models for detecting spoofing attacks from images.
https://github.com/ternaus/datasouls_antispoof

antispoofing computer-vision deep-learning image-classification liveness-detection neural-network

Last synced: 9 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# Anti spoofing with the Datasouls dataset
![](https://habrastorage.org/webt/uv/7u/ws/uv7uwsjkcz732_vhf0opx3zfjrc.jpeg)

## Installation
`pip install -U datasouls_antispoof`

### Example inference

Colab notebook with the example: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1HN0xmAUjfgVLccCV_QQ2Zg98WD9BZeNW?usp=sharing)

## Dataset

[ID & RD anti spoofing challenge](https://ods.ai/competitions/idrnd-facial-antispoofing)

Four types of images:
* real
* replay
* printed
* mask2d

## Training

### Define the config.
Example at [datasoluls_antispoof/configs](datasouls_antispoof/configs)

### Define the environmental variable `IMAGE_PATH` that points to the folder with the dataset.
Example:
```bash
export IMAGE_PATH=
```
## Inference

```bash
python -m torch.distributed.launch --nproc_per_node= datasouls_antispoof/inference.py \
-i \
-c \
-w \
-o \
--fp16
```

## Pre-trained models

| Models | Validation accuracy | Config file | Weights |
| ------------- |:--------------------:| :------------:| :------: |
| swsl_resnext50_32x4d | 0.9673 | [Link](datasouls_antispoof/configs/2020-11-30b.yaml) | [Link](https://github.com/ternaus/datasouls_antispoof/releases/download/0.0.1/2020-11-30b_resnext50_32x4d.zip) |
| tf_efficientnet_b3_ns | 0.9927 |[Link](datasoluls_antispoof/configs/2020-12-02.yaml)| [Link](https://github.com/ternaus/datasouls_antispoof/releases/download/0.0.2/2020-12-02_efficientnet_b3.zip)|