This repo contains the PyTorch implementation of the paper 'Deepfake Video Detection through Optical Flow based CNN'.
In this work, we train and evaluate the ResNet-50/VGG-16/ViT/DeiT models on the FaceForensics++ Dataset, which can be found here.
Main algorithm
In order to run the notebook locally, make sure to meet the following library requirements:
- tqdm
- gdown
- cv2
- timm
- transformers
- torch
You can install them through:
pip install -U tqdm gdown opencv-python timm transformers
Refer to the PyTorch website for local installation of PyTorch.
For Optical Flow algorithms, we used the Sniklaus and Hmorimitsu repos for Optical Flow Estimation.
Simply, run any notebook inside the training models
directory.
You can choose between:
training models/resnet.ipynb
(Runs the algorithm through the ResNet-50/152 model)training models/vgg16.ipynb
(Runs the algorithm through the VGG16 model)training models/Transformers.ipynb
(Runs the algorithm through the ViT or DeiT model)
As for the results, we have a table in the training models
directory, summing up all the results we had.
Giancarlo Tedesco