https://github.com/s0md3v/roop Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} s0md3v / roop Public * * Notifications * Fork 125 * Star 1.4k one-click deepfake (face swap) License AGPL-3.0 license 1.4k stars 125 forks Star Notifications * Code * Issues 4 * Pull requests 1 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights s0md3v/roop This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/s] Use Git or checkout with SVN using the web URL. [gh repo clone s0md3v] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @s0md3v s0md3v better gui ... a440cef May 29, 2023 better gui a440cef Git stats * 61 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time core reverse providers logic May 29, 2023 23:10 LICENSE Initial commit May 28, 2023 20:07 README.md install c++ in windows May 29, 2023 23:16 demo.gif made the gif loopable May 28, 2023 20:28 gui-demo.png gui demo May 28, 2023 21:04 requirements.txt Adding package versions May 29, 2023 19:02 run.py better gui May 30, 2023 04:27 View code Installation GPU Accleration (Optional) NVIDIA AMD Usage Future plans Credits README.md 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. That's it, that's the software. You can watch some demos here. demo-gif Installation Do not create any issues regarding installation problems. I am only responsible for issues in this program, use google for help. 1. install python, pip and git 2. install ffmpeg 3. run the following commands in terminal: git clone https://github.com/s0md3v/roop cd roop pip install -r requirements.txt 4. Download this file and keep it in roop directory. Mirror #1, Mirror #2, Mirror #3 5. If you are on windows, you will need to install Microsoft Visual C++ 14.0. Google how to do that. GPU Accleration (Optional) If you have a good enough GPU, you can use it to speed-up the face-swapping process by running run.py with --gpu flag. If you plan on doing it, you will need to install the appropriate onnxruntime-* package as follows: NVIDIA Install cuda and then, pip install onnxruntime-gpu AMD Install ROCM-based torch packages from here and then, git clone https://github.com/microsoft/onnxruntime cd onnxruntime ./build.sh --config Release --build_wheel --update --build --parallel --cmake_extra_defines CMAKE_PREFIX_PATH=/opt/rocm/lib/cmake ONNXRUNTIME_VERSION=$ONNXRUNTIME_VERSION onnxruntime_BUILD_UNIT_TESTS=off --use_rocm --rocm_home=/opt/rocm pip install build/Linux/Release/dist/*.whl Usage 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: gui-demo 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 where you can see the frames being swapped in realtime. Once the processing is done, it will create the output file. That's it. Don't touch the FPS checkbox unless you know what you are doing. Additional command line arguments are given below: -h, --help show this help message and exit -f SOURCE_IMG, --face SOURCE_IMG use this face -t TARGET_PATH, --target TARGET_PATH replace this face -o OUTPUT_FILE, --output OUTPUT_FILE save output to this file --keep-fps keep original fps --gpu use gpu --keep-frames don't delete frames directory Looking for a CLI mode? Using the -f/--face argument will make the program in cli mode. Future plans * [ ] Replace a selective face throughout the video * [ ] Support for replacing multiple faces Credits * ffmpeg: for making video related operations easy * deepinsight: for their insightface project which provided a well-made library and models. * and all developers behind libraries used in this project. About one-click deepfake (face swap) Resources Readme License AGPL-3.0 license Stars 1.4k stars Watchers 24 watching Forks 125 forks Report repository Releases No releases published Sponsor this project * * https://paypal.me/s0md3v Learn more about GitHub Sponsors Packages 0 No packages published Contributors 5 * @s0md3v * @osma * @henryruhs * @hasanisaeed * @SkalskiP Languages * Python 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.