Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
-
pipeline_tag: image-classification
|
| 4 |
library_name: transformers
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
| 3 |
library_name: transformers
|
| 4 |
+
tags:
|
| 5 |
+
- pytorch
|
| 6 |
+
- image-classification
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Deepfake Detection that Generalizes Across Benchmarks (WACV 2026)
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
[](https://arxiv.org/abs/2508.06248)
|
| 13 |
+
[](https://github.com/yermandy/GenD)
|
| 14 |
+
|
| 15 |
+
This is the GenD (PE) model from Tab. 2 in the paper.
|
| 16 |
+
|
| 17 |
+
## Set up environment
|
| 18 |
+
|
| 19 |
+
``` bash
|
| 20 |
+
conda create --name GenD python=3.12 uv
|
| 21 |
+
conda activate GenD
|
| 22 |
+
uv pip install -r requirements.txt
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
``` python
|
| 28 |
+
import requests
|
| 29 |
+
import torch
|
| 30 |
+
from PIL import Image
|
| 31 |
+
|
| 32 |
+
from src.hf.modeling_gend import GenD
|
| 33 |
+
|
| 34 |
+
model = GenD.from_pretrained("yermandy/GenD_PE_L")
|
| 35 |
+
|
| 36 |
+
urls = [
|
| 37 |
+
"https://github.com/yermandy/deepfake-detection/blob/main/datasets/FF/DF/000_003/000.png?raw=true",
|
| 38 |
+
"https://github.com/yermandy/deepfake-detection/blob/main/datasets/FF/real/000/000.png?raw=true",
|
| 39 |
+
]
|
| 40 |
+
images = [Image.open(requests.get(url, stream=True).raw) for url in urls]
|
| 41 |
+
tensors = torch.stack([model.feature_extractor.preprocess(img) for img in images])
|
| 42 |
+
logits = model(tensors)
|
| 43 |
+
probs = logits.softmax(dim=-1)
|
| 44 |
+
|
| 45 |
+
print(probs)
|
| 46 |
+
```
|