Other

项目介绍

mapooon/SelfBlendedImages 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Other 许可证,目前获得 278 个 Star、44 次 Fork。

仓库全名
mapooon/SelfBlendedImages
开源许可证
Other
Star 数
278
Fork 数
44
未关闭 Issue
26

README 摘要

Detecting Deepfakes with Self-Blended Images The official PyTorch implementation for the following paper: Detecting Deepfakes with Self-Blended Images, Kaede Shiohara and Toshihiko Yamasaki, CVPR 2022 Oral License Our code and pretrained model are freely available for research purpose. For commercial use: A license agreement is required. See the license for more details and contact the author Kaede Shiohara. News…

完整内容见 GitHub 原始 README 或本页 。

常见问题

SelfBlendedImages 用什么语言开发?

主要使用 Python 编写,采用 Other 许可证,目前有 278 个 Star。

SelfBlendedImages 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 SelfBlendedImages 的源码?

可以直接克隆仓库:git clone https://github.com/mapooon/SelfBlendedImages.git,默认分支为 master;安装与运行步骤见仓库 README。

SelfBlendedImages 最近还在维护吗?

仓库最近一次更新为 3月13日,当前有 26 个未关闭 Issue;Star 数为 278,可作为社区活跃度的参考。

简要分析

热度分
372
价值分
179
活跃状态
活跃

语言占比

Dockerfile
Python
Shell

README

Detecting Deepfakes with Self-Blended Images

Overview
The official PyTorch implementation for the following paper:

Detecting Deepfakes with Self-Blended Images,
Kaede Shiohara and Toshihiko Yamasaki,
CVPR 2022 Oral

License

Our code and pretrained model are freely available for research purpose.
For commercial use:

  • A license agreement is required.
  • See the license for more details and contact the author Kaede Shiohara.

News

3.13.2026: We have released a new paper on reference-based deepfake detection accepted to CVPR2026 Findings🎉🎉🎉
ExposeAnyone: Personalized Audio-to-Expression Diffusion Models are Robust Zero-Shot Face Forgery Detectors

Changelog

3.2.2023: Fixed bug in preprocessing code. We recommend that those who have any problems in reproducing the experimental results try again from the preprocessing.

13.9.2022: Added an inference code for FF++

10.9.2022: Added a weight trained on c23 of FF++

19.5.2022: Released training/inference code and a pretrained weight.

19.4.2022: Pre-released this repository

Recomended Development Environment

  • GPU: NVIDIA A100
  • CUDA: 11.1
  • Docker: 20.10.8

Setup

1. Dataset

Download datasets and place them in ./data/ folder.
For example, download Celeb-DF-v2 and place it:

.
└── data
    └── Celeb-DF-v2
        ├── Celeb-real
        │   └── videos
        │       └── *.mp4
        ├── Celeb-synthesis
        │   └── videos
        │       └── *.mp4
        ├── Youtube-real
        │   └── videos
        │       └── *.mp4
        └── List_of_testing_videos.txt

For other datasets, please refer to ./data/datasets.md .

2. Pretrained model

We provide weights of EfficientNet-B4 trained on SBIs from FF-raw and FF-c23.
Download [raw][c23] and place it in ./weights/ folder.

3. Docker

  1. Replace the absolute path to this repository in ./exec.sh .
  2. Run the scripts:
bash build.sh
bash exec.sh

Test

For example, run the inference on Celeb-DF-v2:

CUDA_VISIBLE_DEVICES=* python3 src/inference/inference_dataset.py \
-w weights/FFraw.tar \
-d CDF

The result will be displayed.

Using the provided pretrained model, our cross-dataset results are reproduced as follows:

Training Data CDF DFD DFDC DFDCP FFIW
FF-raw 93.82% 97.87% 73.01% 85.70% 84.52%
FF-c23 92.87% 98.16% 71.96% 85.51% 83.22%

We also provide an inference code for video:

CUDA_VISIBLE_DEVICES=* python3 src/inference/inference_video.py \
-w weights/FFraw.tar \
-i /path/to/video.mp4

and for image:

CUDA_VISIBLE_DEVICES=* python3 src/inference/inference_image.py \
-w weights/FFraw.tar \
-i /path/to/image.png

Training

  1. Download FF++ real videos and place them in ./data/ folder:
.
└── data
    └── FaceForensics++
        ├── original_sequences
        │   └── youtube
        │       └── raw
        │           └── videos
        │               └── *.mp4
        ├── train.json
        ├── val.json
        └── test.json
  1. Download landmark detector (shape_predictor_81_face_landmarks.dat) from here and place it in ./src/preprocess/ folder.

  2. Run the two codes to extractvideo frames, landmarks, and bounding boxes:

python3 src/preprocess/crop_dlib_ff.py -d Original
CUDA_VISIBLE_DEVICES=* python3 src/preprocess/crop_retina_ff.py -d Original
  1. (Option) You can download code for landmark augmentation:
mkdir src/utils/library
git clone https://github.com/AlgoHunt/Face-Xray.git src/utils/library

Even if you do not download it, our training code works without any error. (The performance of trained model is expected to be lower than with it.)

  1. Run the training:
CUDA_VISIBLE_DEVICES=* python3 src/train_sbi.py \
src/configs/sbi/base.json \
-n sbi

Top five checkpoints will be saved in ./output/ folder. As described in our paper, we use the latest one for evaluations.

Citation

If you find our work useful for your research, please consider citing our paper:

@inproceedings{shiohara2022detecting,
  title={Detecting Deepfakes with Self-Blended Images},
  author={Shiohara, Kaede and Yamasaki, Toshihiko},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={18720--18729},
  year={2022}
}

评论

暂无评论