GithubHelp home page GithubHelp logo

daisy-zhang / face-x-ray Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 2.0 436 KB

This is an unofficial implementation of Lingzhi Li, Jianmin Bao, Ting Zhang, Hao Yang, Dong Chen, Fang Wen, Baining Guo: Face X-Ray for More General Face Forgery Detection. CVPR 2020: 5000-5009.

Python 100.00%
deepfakes face-x-ray paper-code face

face-x-ray's Introduction

Face_X-ray

This is an unofficial implementation of Lingzhi Li, Jianmin Bao, Ting Zhang, Hao Yang, Dong Chen, Fang Wen, Baining Guo: Face X-Ray for More General Face Forgery Detection. CVPR 2020: 5000-5009.

Install Dependancies

Users can use following command to install Dependancies:

pip install -r requirements.txt

How to Use

Users can use the following command to get usage:

>> python main.py -h
usage: main.py [-h] --background_img_path BACKGROUND_IMG_PATH --img_db_path IMG_DB_PATH
               --output_img_path OUTPUT_IMG_PATH --output_xray_path OUTPUT_XRAY_PATH

optional arguments:
  -h, --help            show this help message and exit
  --background_img_path BACKGROUND_IMG_PATH, -b BACKGROUND_IMG_PATH
                        background images floder path
  --img_db_path IMG_DB_PATH, -i IMG_DB_PATH
                        image database for key-points-nearest-search
  --output_img_path OUTPUT_IMG_PATH, -oi OUTPUT_IMG_PATH
                        output blended image folder path to store output
  --output_xray_path OUTPUT_XRAY_PATH, -ox OUTPUT_XRAY_PATH
                        output x-ray folder path to store output
  • --background_img_path: the background images database searched by our algorithm.
  • --img_db_path: target face images.
  • --output_img_path: output path of the generated face image.
  • --output_xray_path: output path of the generated face x-ray.

An example can be as follows:

python main.py --background_img_path=./background_img --img_db_path=./img_db --output_img_path=./output --output_xray_path=./output_xray

Structure

/background_img

Background images to search the nearest target face to swap.

/img_db

Images to be swapped.

convex_hull.py

Caculate the convex hull of people face.

Gaussian_blur.py

Add Gaussian blur to face X-ray image as the paper described.

get_face_alignment.py

Get the face landmarks of people images.

nearest_search.py

Use nearest search of face landmarks to get the target image face.

generator.py

The main class to generate face X-ray.

utils.py

Some function used by above.

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.