https://github.com/nakahiro1206/realtimefaceswap
real-time face swap with insightface
https://github.com/nakahiro1206/realtimefaceswap
codeformer insightface opencv-python python3
Last synced: about 2 months ago
JSON representation
real-time face swap with insightface
- Host: GitHub
- URL: https://github.com/nakahiro1206/realtimefaceswap
- Owner: nakahiro1206
- Created: 2024-06-04T16:51:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-07T00:10:48.000Z (about 1 year ago)
- Last Synced: 2025-04-09T12:22:13.363Z (6 months ago)
- Topics: codeformer, insightface, opencv-python, python3
- Language: Python
- Homepage:
- Size: 23.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RealTimeFaceSwap
### Overview
This project is about face-swapping processing in video.
Inspirations are [iperov/DeepFaceLive](https://github.com/iperov/DeepFaceLive) and [haofanwang/inswapper](https://github.com/haofanwang/inswapper).### Adopted techniques
* Face detection & face swapping: [deepinsight/insightface](https://github.com/deepinsight/insightface)
* The model used for swapping is [ezioruan/inswapper_128.onnx](https://huggingface.co/ezioruan/inswapper_128.onnx)
* Upsampling of swapped images: [sczhou/CodeFormer](https://github.com/sczhou/CodeFormer)### Demonstration
Suppose you want to swap your face with the image below,
Source by [Pexels.com](https://www.pexels.com/search/woman/)
InsightFace recognizes your face and replaces yours to the input image.

The swapped image is a little rough and CodeFormers upsamples face area.

### Source code
Some codes are borrowed from [sczhou/CodeFormer](https://github.com/sczhou/CodeFormer)
- ```basicsr/```
- ```facelib/```
- ```weights/```
- ```FaceRestorationHelperWrapper.py``` largely stems from ```inference_codeformer.py```### Installation of the required packages
```pip install opencv-python torch torchvision insightface```### Ref. useful pre-trained models worth trying(I did not though)
[Releases/Sapphire](https://github.com/Hillobar/Rope/releases/tag/Sapphire)