https://github.com/ibonn/faceswap_gl
Face swap using Python + OpenGL
https://github.com/ibonn/faceswap_gl
face face-swap face-swapping faceswap opengl python
Last synced: 2 months ago
JSON representation
Face swap using Python + OpenGL
- Host: GitHub
- URL: https://github.com/ibonn/faceswap_gl
- Owner: ibonn
- License: mit
- Created: 2021-11-01T11:38:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-21T13:36:15.000Z (almost 4 years ago)
- Last Synced: 2025-01-29T21:44:13.523Z (over 1 year ago)
- Topics: face, face-swap, face-swapping, faceswap, opengl, python
- Language: Python
- Homepage:
- Size: 7.09 MB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# faceswap_gl
Face swap using Python + OpenGL

This implementation finds facial landmarks on both the source and destination images, and generates a texture to be used on a 3D model of the face. This Model is then positioned over the destination image using the landmarks.
| Source | Destination | Texture | 3D face | Result |
| ------ | ------- | ----------- | ------------------ | ------ |
|  |  |  |  |  |
## Installation
Clone the repo
```
git clone https://github.com/ibonn/faceswap_gl.git
```
Install required modules
```
cd faceswap_gl/
pip install -r requirements.txt
```
## Usage
Basic usage
```
python swap.py -s -d -o
```
More options:
* **-s/--src**: Path to the source image
* **-d/--dst**: Path to the destination image/video
* **-o/--output**: Output path
* **-t/--texture**: Size of the texture. The lower the value the faster the program starts (but the source face resolution is lower). Defaults to 256px
* **-b/--border**: Padding size. Not implemented yet
* **-m/--mask**: Output a video with the mask
Example:
```
python swap.py -s tomhanks.jpg -d dicaprio.mp4 -o out.mp4 -t 1024
```