## Real-Time Deepfake Detection in the Real-World

Pytorch implementation of Real-Time Deepfake Detection in the Real-World.
## Installation
Create a virtual environment, activate it and install the requirements file:

```
virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
pip install -r requirements.txt
```
## Datasets
- ForenSynth and UFD datasets can be found in: [CNNDetection](https://github.com/peterwang512/CNNDetection), [UniversalFakeDetect](https://github.com/Yuheng-Li/UniversalFakeDetect).
- Our WildRF dataset will be opensource upon releasing our code.

## Training
- LaDeDa can be trained with the following command:
```bash
python3 train.py --name LaDeDa --dataroot {PATH_TO_TRAIN_SET} --checkpoints_dir {./NAME_OF_CHECKPOINT} --batch_size 32 --lr 0.0002 --delr_freq 10
```
if training LaDeDa on ForenSynth, you should also add ProGAN classes argument:
```bash
--classes airplane,bird,bicycle,boat,bottle,bus,car,cat,cow,chair,diningtable,dog,person,pottedplant,motorbike,tvmonitor,train,sheep,sofa,horse
```
- To train Tiny-LaDeDa, run extract_patches.py file first, to obtain the distillation train set, and then run train_Tiny_LaDeDa.py

## Evaluating
- To evaluate LaDeDa
```bash
python3 test.py --dataroot {PATH_TO_TEST_SET} --model_path {PATH_TO_CHECKPOINT.pth} --batch_size 32
```