Files
insightface/examples/in_swapper/README.md
2022-11-28 22:50:28 +08:00

1.5 KiB

InsightFace Swapper

In this example, we provide one-line simple code for subject agnostic identity transfer from source face to the target face.

The input and output resolution of this tool is 128x128, which is obviously smaller than our online demo.

The network size and computation complexity are both very large, so do not use it in any product, but for academic purposes instead.

Usage

Firstly install insightface python library, with version>=0.7:

pip install -U insightface

Then use buffalo_l recognition model and initialize the INSwapper class.

Note that now we can only accept latent embedding from the buffalo_l arcface model, otherwise the result will be not normal.

The auto-downloading of inswapper_128.onnx may be disabled in future if the network traffic is too high. You can also download from googledrive instead and put it under ~/.insightface/models/.

For detail code, please check the example.

Result:

Input:

---Then we change the identity to Ross for all faces in this image.---

Direct Outputs:

Paste Back: