roop/README.md

67 lines
3.5 KiB
Markdown
Raw Normal View History

2023-05-28 22:49:40 +08:00
Take a video and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training.
2023-05-29 17:10:10 +08:00
That's it, that's the software. You can watch some demos [here](https://drive.google.com/drive/folders/1KHv8n_rd3Lcr2v7jBq1yPSTWM554Gq8e?usp=sharing).
2023-05-28 22:49:40 +08:00
![demo-gif](demo.gif)
2023-06-01 05:45:33 +08:00
## Disclaimer
Better deepfake software than this already exist, this is just a hobby project I created to learn about AI. Users must get consent from the concerned people before using their face and must not hide the fact that it is a deepfake when posting content online. I am not responsible for malicious behaviour of end-users.
To prevent misuse, it has a built-in check which prevents the program from working on inappropriate media.
2023-05-30 12:51:07 +08:00
## How do I install it?
2023-06-01 06:30:51 +08:00
**Issues according installation will be closed without ceremony from now on, we cannot handle the amount of requests.**
2023-05-30 12:08:19 +08:00
There are two types of installations: basic and gpu-powered.
- **Basic:** It is more likely to work on your computer but it will also be very slow. You can follow instructions for the basic install [here](https://github.com/s0md3v/roop/wiki/1.-Installation).
- **GPU:** If you have a good GPU and are ready for solving any software issues you may face, you can enable GPU which is wayyy faster. To do this, first follow the basic install instructions given above and then follow GPU-specific instructions [here](https://github.com/s0md3v/roop/wiki/2.-GPU-Acceleration).
2023-05-30 10:56:28 +08:00
2023-05-30 12:51:07 +08:00
## How do I use it?
2023-05-28 22:49:40 +08:00
> Note: When you run this program for the first time, it will download some models ~300MB in size.
Executing `python run.py` command will launch this window:
2023-05-28 23:35:38 +08:00
![gui-demo](gui-demo.png)
2023-05-28 22:49:40 +08:00
2023-05-29 20:15:32 +08:00
Choose a face (image with desired face) and the target image/video (image/video in which you want to replace the face) and click on `Start`. Open file explorer and navigate to the directory you select your output to be in. You will find a directory named `<video_title>` where you can see the frames being swapped in realtime. Once the processing is done, it will create the output file. That's it.
2023-05-28 22:49:40 +08:00
Don't touch the FPS checkbox unless you know what you are doing.
Additional command line arguments are given below:
2023-05-31 02:43:03 +08:00
2023-05-28 22:49:40 +08:00
```
2023-05-30 16:15:25 +08:00
options:
-h, --help show this help message and exit
-f SOURCE_IMG, --face SOURCE_IMG
2023-05-28 22:49:40 +08:00
use this face
2023-05-30 16:15:25 +08:00
-t TARGET_PATH, --target TARGET_PATH
2023-05-28 22:49:40 +08:00
replace this face
2023-05-31 02:43:03 +08:00
-o OUTPUT_FILE, --output OUTPUT_FILE
save output to this file
--keep-fps maintain original fps
--keep-frames keep frames directory
--all-faces swap all faces in frame
2023-05-31 02:43:03 +08:00
--max-memory MAX_MEMORY
2023-06-01 01:37:33 +08:00
maximum amount of RAM in GB to be used
--cpu-threads CPU_THREADS
number of threads to be use for CPU mode
--gpu-threads GPU_THREADS
number of threads to be use for GPU moded
--gpu-vendor {amd,intel,nvidia}
choice your gpu vendor
2023-05-28 22:49:40 +08:00
```
Looking for a CLI mode? Using the -f/--face argument will make the program in cli mode.
## Future plans
2023-05-30 10:49:48 +08:00
- [ ] Improve the quality of faces in results
2023-05-28 22:49:40 +08:00
- [ ] Replace a selective face throughout the video
- [ ] Support for replacing multiple faces
## Credits
- [ffmpeg](https://ffmpeg.org/): for making video related operations easy
- [deepinsight](https://github.com/deepinsight): for their [insightface](https://github.com/deepinsight/insightface) project which provided a well-made library and models.
- and all developers behind libraries used in this project.