Code Monkey home page Code Monkey logo

face-forgery-detection's Introduction

Face-Forgery-Detection

This is the unofficial implementation of the core two-stream model from Generalizing Face Forgery Detection with High-frequency Features (CVPR 2021) in Pytorch. The original paper [here](Generalizing Face Forgery Detection With High-Frequency Features (thecvf.com))

Model

The overall network is shown as follows Model

Environment

  • pytorch 1.7
  • dlib
  • cv2
  • tqdm
  • Linux

Structure

|-- compare.py                # compare the results of testdata labels
|-- components                # modules of the network
|   |-- __init__.py
|   |-- __pycache__
|   |-- attention.py          # attention module
|   |-- srm_conv.py           # srm_conv module
|-- dataset.py                # load the train data or val data
|-- loss                      # Loss Function
|   |-- __pycache__
|   |-- am_softmax.py         # am_softmax loss
|-- model_core.py             # the main network in this paper
|-- networks                  # baseline network
|   |-- __pycache__
|   |-- xception-b5690688.pth # pretrained baseline network
|   |-- xception.py           # baseline network
|-- test.py                   # test code
|-- train.py                  # train code

How to Use

  • For the test, run the test.py and set the args
python test.py --cuda_id 0 --test_dir /home/train --pre_model /home/model
  • For the train, run the train.py and set the args
python train.py --cuda_id 0 --train_label /home/label --train_dir /home/train --val_dir /home/val --save_model /home/result
  • Note
The size of training images is 256x256
The label of training images is a xxx.csv file(including all images' label: filename and label)

Reference

https://github.com/592McAvoy/face-forgery-detection

face-forgery-detection's People

Contributors

yurizzzzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.