Skip to content

Latest commit

 

History

History

facefusion

FaceFusion

Inputs

Source image

(Image from https://github.com/facefusion/facefusion-assets/releases/download/examples/source.jpg)

Target image

(Image from https://github.com/facefusion/facefusion-assets/releases/download/examples/target-1080p.mp4)

Output

Requirements

This model requires additional module.

# Install onnx https://pypi.org/project/onnx/
pip3 install onnx

Usage

Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.

For the sample image,

$ python3 facefusion.py

If you want to specify the input target image, put the image path after the --input option. You can use --savepath option to change the name of the output file to save.

$ python3 facefusion.py --input TARGET_IMAGE_PATH --savepath SAVE_IMAGE_PATH

If you want to specify the input source image, put the image path after the --source option.

$ python3 facefusion.py --input TARGET_IMAGE_PATH --source SOURCE_IMAGE_PATH --savepath SAVE_IMAGE_PATH

By adding the --video option, you can input the video. If you pass 0 as an argument to VIDEO_PATH, you can use the webcam input instead of the video file.

$ python3 facefusion.py --video VIDEO_PATH

By adding the --skip_enhance option, you can skip the face enhancement process (for a quicker inference but lesser quality).

$ python3 facefusion.py --skip_enhance

Reference

Framework

ONNXRuntime

Model Format

ONNX opset=11 for 2dfan4.onnx, arcface_w600k_r50.onnx, inswapper_128.onnx, gfpgan_1.4.onnx

ONNX opset=12 for yoloface_8n.onnx

Netron