├── README.md └── Deepfake.ipynb /README.md: -------------------------------------------------------------------------------- 1 | # Deepfake-with-Google-Colab -------------------------------------------------------------------------------- /Deepfake.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github", 7 | "colab_type": "text" 8 | }, 9 | "source": [ 10 | "\"Open" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "source": [ 16 | "# DeepFake\n", 17 | "\n", 18 | "Deepfake is a technology that uses artificial intelligence to manipulate the appearance and voice of a person in a video. Roop uses a face swapping technique that replaces the original face in the video with the desired face, while preserving the facial expressions and movements.\n", 19 | "\n", 20 | "# Roop Repo\n", 21 | "Roop is a repository on GitHub that allows users to create deepfake videos using only one image of the desired face.\n", 22 | "\n", 23 | "Roop was developed by s0md3v, a security researcher and developer from India1. He started the project in May 2021 and discontinued it in August 2023, citing ethical issues and breach of trust by another developer who published a problematic video to the documentation of the project1. Roop has received over 400 commits and 2,000 stars on GitHub1. It has also been forked by other developers who have made some modifications and improvements2" 24 | ], 25 | "metadata": { 26 | "id": "gJ2GigCVQLJI" 27 | } 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": { 32 | "id": "D3L8Lkyj-5gl" 33 | }, 34 | "source": [ 35 | "#Step 1: Clone the Roop repository from Github and install the required dependencies" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "metadata": { 42 | "id": "0aHr4Fo-7IRy" 43 | }, 44 | "outputs": [], 45 | "source": [ 46 | "!git clone https://github.com/s0md3v/roop.git\n", 47 | "%cd roop\n", 48 | "!pip install -r requirements.txt" 49 | ] 50 | }, 51 | { 52 | "cell_type": "markdown", 53 | "metadata": { 54 | "id": "jl9zIFZYGWTQ" 55 | }, 56 | "source": [ 57 | "#Download the Model" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": null, 63 | "metadata": { 64 | "id": "UQH2exUYGTbK" 65 | }, 66 | "outputs": [], 67 | "source": [ 68 | "!wget https://huggingface.co/ezioruan/inswapper_128.onnx/resolve/main/inswapper_128.onnx -O inswapper_128.onnx\n", 69 | "!mkdir models\n", 70 | "!mv inswapper_128.onnx ./models" 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": { 76 | "id": "nCKli1C-_EaO" 77 | }, 78 | "source": [ 79 | "# Replace the\n", 80 | "\n", 81 | "```\n", 82 | "/content/video.mp4 # with your video path\n", 83 | "/content/image.jpeg # with your image to be placed in the video path\n", 84 | "```\n", 85 | "\n" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": null, 91 | "metadata": { 92 | "colab": { 93 | "base_uri": "https://localhost:8080/" 94 | }, 95 | "id": "lDYdfL3L71i1", 96 | "outputId": "d02450f0-387b-486a-a44d-bc79f215f7c7" 97 | }, 98 | "outputs": [ 99 | { 100 | "output_type": "stream", 101 | "name": "stdout", 102 | "text": [ 103 | "Downloading: 332MB [00:02, 125MB/s] \n", 104 | "[ROOP.FACE-SWAPPER] Select an image for source path.\n" 105 | ] 106 | } 107 | ], 108 | "source": [ 109 | "!python run.py --target /content/video.mp4 --output-video-quality 80 --source /content/image.jpeg -o /content/swapped.mp4 --execution-provider cuda --frame-processor face_swapper face_enhancer" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": null, 115 | "metadata": { 116 | "id": "dB-yigWx8zht" 117 | }, 118 | "outputs": [], 119 | "source": [] 120 | } 121 | ], 122 | "metadata": { 123 | "accelerator": "GPU", 124 | "colab": { 125 | "provenance": [], 126 | "include_colab_link": true 127 | }, 128 | "kernelspec": { 129 | "display_name": "Python 3", 130 | "name": "python3" 131 | }, 132 | "language_info": { 133 | "name": "python" 134 | } 135 | }, 136 | "nbformat": 4, 137 | "nbformat_minor": 0 138 | } --------------------------------------------------------------------------------