Roop

Roop: One-Click Deepfake

1 min


Roop

One-Click DeepFake

Github logo

Roop Deepfake is a tool that lets you swap faces in videos with just one image of the desired face. You don’t need to collect many images or train a model to do this. You need to run a Python script and select the face and the target video. Roop Deepfake will do the rest for you. It uses a library called insightface and some models to detect and replace faces. You can also use GPU acceleration to speed up the process. Roop Deepfake is an experimental project that aims to make deepfake technology more accessible and easy to use.

How To Install Roop Deepkafe

1- Basic Installation

  1. install python (ifneed, install pip too)
  2. install git
  3. install ffmpeg
  4. If you are using Windows, you have to install Visual Studio 2022 (with desktop development C++).
  5. git clone https://github.com/s0md3v/roop
  6. cd roop && pip install -r requirements.txt
  7. Download this file and keep it in roop directory. Mirror #1Mirror #2Mirror #3Mirror #4. Rename the downloaded file to inswapper_128.onnx if it isn’t already named.

Done. You should be able to use this tool with the command: python run.py.

1- GPU Acceleration Installation

AMD

  1. pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2
  2. pip uninstall onnxruntime
  3. git clone https://github.com/microsoft/onnxruntime && cd onnxruntime
  4. ./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
  5. pip install build/Linux/Release/dist/*.whl

This guide is for linux users only. Windows does not support AMD GPUs.

NVIDIA

Linux
  1. install CUDA toolkit from here
  2. install CUDNN from here
  3. pip uninstall onnxruntime onnxruntime-gpu
  4. pip install torch torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/cu118
  5. pip install onnxruntime-gpu
Mac
  1. brew install wget cmake protobuf git git-lfs
  2. git clone https://github.com/cansik/onnxruntime-silicon && cd onnxruntime-silicon
  3. ./build-macos.sh
  4. pip install dist/*whl (Depending on the situation, you may have to adapt this step accordingly.)

Intel

  1. pip uninstall onnxruntime
  2. install the intel-specific onnxruntime called OpenVINO

How Roop Works

To start this window, run the command: python run.py

Roop deepfake

To swap faces on photos or videos, follow these steps:

  1. Select a face photo (the one you want to use as a replacement) and a target photo or video (the one you want to change the face on).
  2. Click on Start and wait for the AI to process your request.
  3. Find the output file in the folder you chose. The folder name will be the same as the target file name.
  4. Enjoy your face-swapped result!

Changing the FPS option can cause problems if you are not familiar with it.

Some of the additional command-line arguments that you can use are::

options:
  -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
  --gpu                 use gpu
  --keep-fps            maintain original fps
  --keep-frames         keep frames directory
  --max-memory MAX_MEMORY
                        maximum amount of RAM in GB to be used
  --max-cores CORES_COUNT
                        number of cores to be use for CPU mode

To run the program without a graphical interface, you can use the -f or –face argument. This will enable the CLI mode.

The Roop AI requires some models to function properly. They will be downloaded automatically the first time you execute Roop tool. The total size of the models is about 300MB.

Join Guidady AI Mail List

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.


Like it? Share with your friends!

-9
1 comment, 55 shares, -9 points

One Comment

Your email address will not be published. Required fields are marked *

Belmechri

I am an IT engineer, content creator, and proud father with a passion for innovation and excellence. In both my personal and professional life, I strive for excellence and am committed to finding innovative solutions to complex problems.
Choose A Format
Personality quiz
Series of questions that intends to reveal something about the personality
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Countdown
The Classic Internet Countdowns
Open List
Submit your own item and vote up for the best submission
Ranked List
Upvote or downvote to decide the best list item
Meme
Upload your own images to make custom memes
Video
Youtube and Vimeo Embeds
Audio
Soundcloud or Mixcloud Embeds
Image
Photo or GIF
Gif
GIF format