├── 02.png ├── 09.png ├── got-05.png ├── increasefps.py ├── sample audio output ├── Rohan_audio.wav ├── stevejobs_audio.wav ├── Ritika sigh_audio.wav └── Rohan_shravan_audio.wav ├── Readme.md ├── Deep_Fakes_for_voice_Colab.ipynb └── Deep_Fakes_for_Video_Colab.ipynb /02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/02.png -------------------------------------------------------------------------------- /09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/09.png -------------------------------------------------------------------------------- /got-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/got-05.png -------------------------------------------------------------------------------- /increasefps.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | out = cv2.VideoWriter(str(videoname+"AV.avi"),cv2.VideoWriter_fourcc('X','V','I','D'), fps, (fw,fh)) -------------------------------------------------------------------------------- /sample audio output/Rohan_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/sample audio output/Rohan_audio.wav -------------------------------------------------------------------------------- /sample audio output/stevejobs_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/sample audio output/stevejobs_audio.wav -------------------------------------------------------------------------------- /sample audio output/Ritika sigh_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/sample audio output/Ritika sigh_audio.wav -------------------------------------------------------------------------------- /sample audio output/Rohan_shravan_audio.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajithvcoder/Deepfakes_audio_video/HEAD/sample audio output/Rohan_shravan_audio.wav -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Deep Fake Audio VIdeo with colab 2 | 3 | **Contents:** 4 | 5 | There are three process 6 | 7 | - [Video Generation](#Video-Generation) - A single image is enough 8 | - [Audio Generation](#Audio-Generation) - A single audio is enough you can make any words with it 9 | - [Combine Audio and video](#Combine-Audio-and-video) 10 | 11 | Will covert all manual process to code soon 12 | 13 | Entire process of audio and video generation is in colab so no need to install any thing in local . if you are in linux machine you can use "ffmeg command" to do all preprocessing and post processing below. 14 | 15 | 16 | ## Video Generation 17 | 18 | 19 | 1. have a png file (target person) 20 | 21 | 2. have a video file (specimen person) 22 | 23 | Execute the colab file for video 24 | 25 | 3. Use increasefps.py file to increase FPS and make your video better 26 | 27 | **How to generate good deep fake video** 28 | 29 | Use a 256x256 file and choose one png file in which it is till neck example see this drive (https://drive.google.com/drive/folders/1kZ1gCnpfU0BnpdU47pLM_TQ6RypDDqgw) 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ## Audio Generation 45 | 46 | Note it works for both male and female 47 | 48 | **Instructions in colab for good audio** 49 | 50 | please add within 12 words .. and if u want to generate more paragraph save the generated audio in another name and then generate another audio 51 | 52 | Dont use any punctuations it will produce some noise . Use only one space between words 53 | 54 | 55 | Have the any audio(.wav) file of the person who is the target and read the instruction below and then go to colab 56 | 57 | 58 | 59 | if u dont have (.wav) follow below steps to generate quickly 60 | 61 | **Convert video to audio** 62 | 63 | 1. find a youtube video where the target person is speaking(only the person should speak no background audio or else no other persons voice) and convert to mp3 use this site for converting https://ytmp3.cc/en13/ and download the video 64 | 65 | **Convert mp3 to wav** 66 | 67 | In linux - Using ffmpeg 68 | 69 | ``` 70 | ffmpeg -i input.mp3 output.wav 71 | ``` 72 | 73 | or else follow 2 and 3 points 74 | 75 | 2. Open this site https://online-audio-converter.com/ and Upload the mp3 file and give a DVD resolution and click convert . Now hover over the "Download" button and copy the link . go to google colab and use 76 | below command to copy it to google colab 77 | 78 | ```!wget ``` 79 | 80 | 3.Rename the file name to audio.wav 81 | 82 | ```!mv audio.wav ``` 83 | 84 | 85 | **Audio merger :** 86 | https://clideo.com/merge-wav 87 | 88 | 89 | **Sample audios that i used** 90 | 91 | (In the entire audio only the targeted person will be speaking ) 92 | 93 | - Steve jobs - https://www.youtube.com/watch?v=65_PmYipnpk 94 | - Rohan Shravan - https://www.youtube.com/watch?v=PstVDlK2lGA 95 | - Ritika sighn - https://www.youtube.com/watch?v=QQI7foZMPtE 96 | 97 | 98 | 99 | ## Combine Audio and video 100 | 101 | if you are in linux you can use below command 102 | 103 | ```ffmpeg -i "mres/g_wonder.mp4.mp4" -i "properaudio/c_wonderwoman.wav" -shortest g_wonder.mp4``` 104 | 105 | or else you can use below website which generates without water mark 106 | 107 | 108 | Use this website - https://www.kapwing.com/tools/add-music-to-video 109 | 110 | 111 | 112 | ### Will upgrade the code and process in manner and quality of audio and video asap 113 | 114 | 115 | **Credits :** 116 | 117 | Video - https://towardsdatascience.com/how-to-produce-a-deepfake-video-in-5-minutes-513984fd24b6 118 | 119 | Video - https://www.youtube.com/watch?v=peOKeRBU_uQ 120 | 121 | Audio - https://github.com/CorentinJ/Real-Time-Voice-Cloning.git 122 | 123 | -------------------------------------------------------------------------------- /Deep_Fakes_for_voice_Colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Deep Fakes for voice - Colab .ipynb", 7 | "provenance": [], 8 | "collapsed_sections": [], 9 | "toc_visible": true 10 | }, 11 | "kernelspec": { 12 | "name": "python3", 13 | "display_name": "Python 3" 14 | }, 15 | "accelerator": "GPU" 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "code", 20 | "metadata": { 21 | "id": "FfTsth4Uz6zi", 22 | "colab_type": "code", 23 | "colab": { 24 | "base_uri": "https://localhost:8080/", 25 | "height": 138 26 | }, 27 | "outputId": "a608695a-2451-4dc8-f4d1-da6d85f8d434" 28 | }, 29 | "source": [ 30 | "!git clone https://github.com/CorentinJ/Real-Time-Voice-Cloning.git" 31 | ], 32 | "execution_count": 1, 33 | "outputs": [ 34 | { 35 | "output_type": "stream", 36 | "text": [ 37 | "Cloning into 'Real-Time-Voice-Cloning'...\n", 38 | "remote: Enumerating objects: 5, done.\u001b[K\n", 39 | "remote: Counting objects: 100% (5/5), done.\u001b[K\n", 40 | "remote: Compressing objects: 100% (5/5), done.\u001b[K\n", 41 | "remote: Total 2508 (delta 0), reused 3 (delta 0), pack-reused 2503\u001b[K\n", 42 | "Receiving objects: 100% (2508/2508), 360.78 MiB | 29.67 MiB/s, done.\n", 43 | "Resolving deltas: 100% (1388/1388), done.\n" 44 | ], 45 | "name": "stdout" 46 | } 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "metadata": { 52 | "id": "jAiyiuyw0Hjd", 53 | "colab_type": "code", 54 | "colab": { 55 | "base_uri": "https://localhost:8080/", 56 | "height": 34 57 | }, 58 | "outputId": "47049b41-3b3b-4c6c-979b-02fc1ffe4f5d" 59 | }, 60 | "source": [ 61 | "cd Real-Time-Voice-Cloning/" 62 | ], 63 | "execution_count": 2, 64 | "outputs": [ 65 | { 66 | "output_type": "stream", 67 | "text": [ 68 | "/content/Real-Time-Voice-Cloning\n" 69 | ], 70 | "name": "stdout" 71 | } 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "metadata": { 77 | "id": "CP-TfAer1d_c", 78 | "colab_type": "code", 79 | "colab": { 80 | "base_uri": "https://localhost:8080/", 81 | "height": 225 82 | }, 83 | "outputId": "c8fbbb23-8c1d-4279-92e0-bce3e141439c" 84 | }, 85 | "source": [ 86 | "!pip install -q -r requirements.txt" 87 | ], 88 | "execution_count": 3, 89 | "outputs": [ 90 | { 91 | "output_type": "stream", 92 | "text": [ 93 | "\u001b[K |████████████████████████████████| 412.3MB 43kB/s \n", 94 | "\u001b[K |████████████████████████████████| 686kB 30.8MB/s \n", 95 | "\u001b[K |████████████████████████████████| 245kB 38.9MB/s \n", 96 | "\u001b[K |████████████████████████████████| 76.6MB 38kB/s \n", 97 | "\u001b[K |████████████████████████████████| 3.8MB 30.4MB/s \n", 98 | "\u001b[K |████████████████████████████████| 512kB 34.6MB/s \n", 99 | "\u001b[K |████████████████████████████████| 204kB 38.6MB/s \n", 100 | "\u001b[K |████████████████████████████████| 286kB 38.5MB/s \n", 101 | "\u001b[?25h Building wheel for visdom (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 102 | " Building wheel for gast (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 103 | " Building wheel for torchfile (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 104 | "\u001b[31mERROR: tensorflow-probability 0.10.0 has requirement gast>=0.3.2, but you'll have gast 0.2.2 which is incompatible.\u001b[0m\n" 105 | ], 106 | "name": "stdout" 107 | } 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "metadata": { 113 | "id": "tzsDe3Ea1g0F", 114 | "colab_type": "code", 115 | "colab": { 116 | "base_uri": "https://localhost:8080/", 117 | "height": 156 118 | }, 119 | "outputId": "a5ca3c0b-8879-4f47-d68c-4b0f9c72a2ca" 120 | }, 121 | "source": [ 122 | "!apt-get install -qq libportaudio2" 123 | ], 124 | "execution_count": 4, 125 | "outputs": [ 126 | { 127 | "output_type": "stream", 128 | "text": [ 129 | "Selecting previously unselected package libportaudio2:amd64.\n", 130 | "(Reading database ... 144465 files and directories currently installed.)\n", 131 | "Preparing to unpack .../libportaudio2_19.6.0-1_amd64.deb ...\n", 132 | "Unpacking libportaudio2:amd64 (19.6.0-1) ...\n", 133 | "Setting up libportaudio2:amd64 (19.6.0-1) ...\n", 134 | "Processing triggers for libc-bin (2.27-3ubuntu1) ...\n", 135 | "/sbin/ldconfig.real: /usr/local/lib/python3.6/dist-packages/ideep4py/lib/libmkldnn.so.0 is not a symbolic link\n", 136 | "\n" 137 | ], 138 | "name": "stdout" 139 | } 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "metadata": { 145 | "id": "SdhwjwQ82Vt_", 146 | "colab_type": "code", 147 | "colab": { 148 | "base_uri": "https://localhost:8080/", 149 | "height": 86 150 | }, 151 | "outputId": "da69f47f-b650-4d07-dfc8-5f0bf8139681" 152 | }, 153 | "source": [ 154 | "!gdown https://drive.google.com/uc?id=1n1sPXvT34yXFLT47QZA6FIRGrwMeSsZc" 155 | ], 156 | "execution_count": 5, 157 | "outputs": [ 158 | { 159 | "output_type": "stream", 160 | "text": [ 161 | "Downloading...\n", 162 | "From: https://drive.google.com/uc?id=1n1sPXvT34yXFLT47QZA6FIRGrwMeSsZc\n", 163 | "To: /content/Real-Time-Voice-Cloning/pretrained.zip\n", 164 | "384MB [00:02, 163MB/s]\n" 165 | ], 166 | "name": "stdout" 167 | } 168 | ] 169 | }, 170 | { 171 | "cell_type": "code", 172 | "metadata": { 173 | "id": "BOCMfzyt2cFH", 174 | "colab_type": "code", 175 | "colab": { 176 | "base_uri": "https://localhost:8080/", 177 | "height": 242 178 | }, 179 | "outputId": "655f89c8-9776-4f12-acb8-4950aa1d7463" 180 | }, 181 | "source": [ 182 | "!unzip pretrained.zip" 183 | ], 184 | "execution_count": 6, 185 | "outputs": [ 186 | { 187 | "output_type": "stream", 188 | "text": [ 189 | "Archive: pretrained.zip\n", 190 | " creating: encoder/saved_models/\n", 191 | " inflating: encoder/saved_models/pretrained.pt \n", 192 | " creating: synthesizer/saved_models/\n", 193 | " creating: synthesizer/saved_models/logs-pretrained/\n", 194 | " creating: synthesizer/saved_models/logs-pretrained/taco_pretrained/\n", 195 | " extracting: synthesizer/saved_models/logs-pretrained/taco_pretrained/checkpoint \n", 196 | " inflating: synthesizer/saved_models/logs-pretrained/taco_pretrained/tacotron_model.ckpt-278000.data-00000-of-00001 \n", 197 | " inflating: synthesizer/saved_models/logs-pretrained/taco_pretrained/tacotron_model.ckpt-278000.index \n", 198 | " inflating: synthesizer/saved_models/logs-pretrained/taco_pretrained/tacotron_model.ckpt-278000.meta \n", 199 | " creating: vocoder/saved_models/\n", 200 | " creating: vocoder/saved_models/pretrained/\n", 201 | " inflating: vocoder/saved_models/pretrained/pretrained.pt \n" 202 | ], 203 | "name": "stdout" 204 | } 205 | ] 206 | }, 207 | { 208 | "cell_type": "code", 209 | "metadata": { 210 | "id": "qLN_Z4qW2pe0", 211 | "colab_type": "code", 212 | "colab": {} 213 | }, 214 | "source": [ 215 | "# Code for recording audio from the browser\n", 216 | "from IPython.display import Javascript\n", 217 | "from google.colab import output\n", 218 | "from base64 import b64decode\n", 219 | "import IPython\n", 220 | "import uuid\n", 221 | "from google.colab import output\n", 222 | "\n", 223 | "\n", 224 | "class InvokeButton(object):\n", 225 | " def __init__(self, title, callback):\n", 226 | " self._title = title\n", 227 | " self._callback = callback\n", 228 | "\n", 229 | " def _repr_html_(self):\n", 230 | " from google.colab import output\n", 231 | " callback_id = 'button-' + str(uuid.uuid4())\n", 232 | " output.register_callback(callback_id, self._callback)\n", 233 | "\n", 234 | " template = \"\"\"\n", 235 | " \"\"\"\n", 241 | " html = template.format(title=self._title, callback_id=callback_id)\n", 242 | " return html\n", 243 | "\n", 244 | "RECORD = \"\"\"\n", 245 | "const sleep = time => new Promise(resolve => setTimeout(resolve, time))\n", 246 | "const b2text = blob => new Promise(resolve => {\n", 247 | " const reader = new FileReader()\n", 248 | " reader.onloadend = e => resolve(e.srcElement.result)\n", 249 | " reader.readAsDataURL(blob)\n", 250 | "})\n", 251 | "var record = time => new Promise(async resolve => {\n", 252 | " stream = await navigator.mediaDevices.getUserMedia({ audio: true })\n", 253 | " recorder = new MediaRecorder(stream)\n", 254 | " chunks = []\n", 255 | " recorder.ondataavailable = e => chunks.push(e.data)\n", 256 | " recorder.start()\n", 257 | " await sleep(time)\n", 258 | " recorder.onstop = async ()=>{\n", 259 | " blob = new Blob(chunks)\n", 260 | " text = await b2text(blob)\n", 261 | " resolve(text)\n", 262 | " }\n", 263 | " recorder.stop()\n", 264 | "})\n", 265 | "\"\"\"\n", 266 | "\n", 267 | "def record(sec=3):\n", 268 | " display(Javascript(RECORD))\n", 269 | " s = output.eval_js('record(%d)' % (sec*1000))\n", 270 | " b = b64decode(s.split(',')[1])\n", 271 | " with open('audio.wav','wb+') as f:\n", 272 | " f.write(b)\n", 273 | " return 'audio.wav'" 274 | ], 275 | "execution_count": 7, 276 | "outputs": [] 277 | }, 278 | { 279 | "cell_type": "code", 280 | "metadata": { 281 | "id": "BcxVTJDT2udB", 282 | "colab_type": "code", 283 | "colab": { 284 | "base_uri": "https://localhost:8080/", 285 | "height": 886 286 | }, 287 | "outputId": "a499f752-1788-48f5-9151-e66686965ee6" 288 | }, 289 | "source": [ 290 | "# To determine which version you're using:\n", 291 | "!pip show tensorflow\n", 292 | "# # For the current version: \n", 293 | "# !pip install --upgrade tensorflow\n", 294 | "# For a specific version:\n", 295 | "# !pip install tensorflow==1.2\n", 296 | "# !pip install tensorflow==1.15.0\n", 297 | "!pip install tensorflow==1.14.0" 298 | ], 299 | "execution_count": 8, 300 | "outputs": [ 301 | { 302 | "output_type": "stream", 303 | "text": [ 304 | "Name: tensorflow\n", 305 | "Version: 1.15.0\n", 306 | "Summary: TensorFlow is an open source machine learning framework for everyone.\n", 307 | "Home-page: https://www.tensorflow.org/\n", 308 | "Author: Google Inc.\n", 309 | "Author-email: packages@tensorflow.org\n", 310 | "License: Apache 2.0\n", 311 | "Location: /usr/local/lib/python3.6/dist-packages\n", 312 | "Requires: tensorboard, wheel, google-pasta, numpy, keras-preprocessing, absl-py, astor, opt-einsum, tensorflow-estimator, protobuf, termcolor, keras-applications, wrapt, six, grpcio, gast\n", 313 | "Required-by: fancyimpute\n", 314 | "Collecting tensorflow==1.14.0\n", 315 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/de/f0/96fb2e0412ae9692dbf400e5b04432885f677ad6241c088ccc5fe7724d69/tensorflow-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (109.2MB)\n", 316 | "\u001b[K |████████████████████████████████| 109.2MB 103kB/s \n", 317 | "\u001b[?25hRequirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (0.8.1)\n", 318 | "Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (0.2.2)\n", 319 | "Requirement already satisfied: numpy<2.0,>=1.14.5 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.18.5)\n", 320 | "Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0\n", 321 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/3c/d5/21860a5b11caf0678fbc8319341b0ae21a07156911132e0e71bffed0510d/tensorflow_estimator-1.14.0-py2.py3-none-any.whl (488kB)\n", 322 | "\u001b[K |████████████████████████████████| 491kB 32.8MB/s \n", 323 | "\u001b[?25hRequirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.30.0)\n", 324 | "Collecting tensorboard<1.15.0,>=1.14.0\n", 325 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/91/2d/2ed263449a078cd9c8a9ba50ebd50123adf1f8cfbea1492f9084169b89d9/tensorboard-1.14.0-py3-none-any.whl (3.1MB)\n", 326 | "\u001b[K |████████████████████████████████| 3.2MB 39.8MB/s \n", 327 | "\u001b[?25hRequirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (0.9.0)\n", 328 | "Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.1.0)\n", 329 | "Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (0.34.2)\n", 330 | "Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.0.8)\n", 331 | "Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (0.2.0)\n", 332 | "Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.15.0)\n", 333 | "Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.1.2)\n", 334 | "Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (1.12.1)\n", 335 | "Requirement already satisfied: protobuf>=3.6.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.14.0) (3.12.2)\n", 336 | "Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (49.1.0)\n", 337 | "Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (1.0.1)\n", 338 | "Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (3.2.2)\n", 339 | "Requirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from keras-applications>=1.0.6->tensorflow==1.14.0) (2.10.0)\n", 340 | "Requirement already satisfied: importlib-metadata; python_version < \"3.8\" in /usr/local/lib/python3.6/dist-packages (from markdown>=2.6.8->tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (1.7.0)\n", 341 | "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < \"3.8\"->markdown>=2.6.8->tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (3.1.0)\n", 342 | "Installing collected packages: tensorflow-estimator, tensorboard, tensorflow\n", 343 | " Found existing installation: tensorflow-estimator 1.15.1\n", 344 | " Uninstalling tensorflow-estimator-1.15.1:\n", 345 | " Successfully uninstalled tensorflow-estimator-1.15.1\n", 346 | " Found existing installation: tensorboard 1.15.0\n", 347 | " Uninstalling tensorboard-1.15.0:\n", 348 | " Successfully uninstalled tensorboard-1.15.0\n", 349 | " Found existing installation: tensorflow 1.15.0\n", 350 | " Uninstalling tensorflow-1.15.0:\n", 351 | " Successfully uninstalled tensorflow-1.15.0\n", 352 | "Successfully installed tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0\n" 353 | ], 354 | "name": "stdout" 355 | } 356 | ] 357 | }, 358 | { 359 | "cell_type": "code", 360 | "metadata": { 361 | "id": "HvX2gbNT2vSd", 362 | "colab_type": "code", 363 | "colab": { 364 | "base_uri": "https://localhost:8080/", 365 | "height": 730 366 | }, 367 | "outputId": "5037a299-31c2-45f2-ef7e-6beb8878239d" 368 | }, 369 | "source": [ 370 | "!pip install unidecode \n", 371 | "!pip install webrtcvad\n", 372 | "from IPython.display import Audio\n", 373 | "from IPython.utils import io\n", 374 | "from synthesizer.inference import Synthesizer\n", 375 | "from encoder import inference as encoder\n", 376 | "from vocoder import inference as vocoder\n", 377 | "from pathlib import Path\n", 378 | "import numpy as np\n", 379 | "import librosa\n", 380 | "encoder_weights = Path(\"encoder/saved_models/pretrained.pt\")\n", 381 | "vocoder_weights = Path(\"vocoder/saved_models/pretrained/pretrained.pt\")\n", 382 | "syn_dir = Path(\"synthesizer/saved_models/logs-pretrained/taco_pretrained\")\n", 383 | "encoder.load_model(encoder_weights)\n", 384 | "synthesizer = Synthesizer(syn_dir)\n", 385 | "vocoder.load_model(vocoder_weights)" 386 | ], 387 | "execution_count": 9, 388 | "outputs": [ 389 | { 390 | "output_type": "stream", 391 | "text": [ 392 | "Requirement already satisfied: unidecode in /usr/local/lib/python3.6/dist-packages (1.1.1)\n", 393 | "Collecting webrtcvad\n", 394 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/89/34/e2de2d97f3288512b9ea56f92e7452f8207eb5a0096500badf9dfd48f5e6/webrtcvad-2.0.10.tar.gz (66kB)\n", 395 | "\u001b[K |████████████████████████████████| 71kB 2.3MB/s \n", 396 | "\u001b[?25hBuilding wheels for collected packages: webrtcvad\n", 397 | " Building wheel for webrtcvad (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 398 | " Created wheel for webrtcvad: filename=webrtcvad-2.0.10-cp36-cp36m-linux_x86_64.whl size=71237 sha256=efe6e1f9cab69b35f02fef6e1e034075e9d10a72c9d578201d8934dbd63cb558\n", 399 | " Stored in directory: /root/.cache/pip/wheels/44/2a/18/bd1aec41cac7c3051fe95d92a6ed446122ea31dc713c432fa1\n", 400 | "Successfully built webrtcvad\n", 401 | "Installing collected packages: webrtcvad\n", 402 | "Successfully installed webrtcvad-2.0.10\n" 403 | ], 404 | "name": "stdout" 405 | }, 406 | { 407 | "output_type": "stream", 408 | "text": [ 409 | "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 410 | " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", 411 | "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 412 | " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", 413 | "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 414 | " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", 415 | "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 416 | " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", 417 | "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 418 | " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", 419 | "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 420 | " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n", 421 | "/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 422 | " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", 423 | "/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 424 | " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", 425 | "/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 426 | " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", 427 | "/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 428 | " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", 429 | "/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 430 | " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", 431 | "/usr/local/lib/python3.6/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", 432 | " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n" 433 | ], 434 | "name": "stderr" 435 | }, 436 | { 437 | "output_type": "stream", 438 | "text": [ 439 | "Loaded encoder \"pretrained.pt\" trained to step 1564501\n", 440 | "Found synthesizer \"pretrained\" trained to step 278000\n", 441 | "Building Wave-RNN\n", 442 | "Trainable Parameters: 4.481M\n", 443 | "Loading model weights at vocoder/saved_models/pretrained/pretrained.pt\n" 444 | ], 445 | "name": "stdout" 446 | } 447 | ] 448 | }, 449 | { 450 | "cell_type": "code", 451 | "metadata": { 452 | "id": "L0nFu9JZ4LuN", 453 | "colab_type": "code", 454 | "colab": { 455 | "base_uri": "https://localhost:8080/", 456 | "height": 208 457 | }, 458 | "outputId": "d2708d21-9ec3-4106-b760-3aa33fb11a46" 459 | }, 460 | "source": [ 461 | "!ls" 462 | ], 463 | "execution_count": null, 464 | "outputs": [ 465 | { 466 | "output_type": "stream", 467 | "text": [ 468 | "audio.wav\t\t requirements.txt\n", 469 | "demo_cli.py\t\t synthesizer\n", 470 | "demo_toolbox_collab.ipynb synthesizer_preprocess_audio.py\n", 471 | "demo_toolbox.py\t\t synthesizer_preprocess_embeds.py\n", 472 | "encoder\t\t\t synthesizer_train.py\n", 473 | "encoder_preprocess.py\t toolbox\n", 474 | "encoder_train.py\t utils\n", 475 | "LICENSE.txt\t\t vocoder\n", 476 | "pretrained.zip\t\t vocoder_preprocess.py\n", 477 | "README.md\t\t vocoder_train.py\n", 478 | "requirements_gpu.txt\n" 479 | ], 480 | "name": "stdout" 481 | } 482 | ] 483 | }, 484 | { 485 | "cell_type": "code", 486 | "metadata": { 487 | "id": "oVLGpCHGvLrt", 488 | "colab_type": "code", 489 | "colab": {} 490 | }, 491 | "source": [ 492 | "" 493 | ], 494 | "execution_count": null, 495 | "outputs": [] 496 | }, 497 | { 498 | "cell_type": "markdown", 499 | "metadata": { 500 | "id": "5HbTCs0jvNEt", 501 | "colab_type": "text" 502 | }, 503 | "source": [ 504 | "# Two options \n", 505 | "if u have a .wav file you can do next 4 cells else go to the next section if u want to generate in live with u r audio" 506 | ] 507 | }, 508 | { 509 | "cell_type": "code", 510 | "metadata": { 511 | "id": "zPJmCP8O5XcC", 512 | "colab_type": "code", 513 | "colab": { 514 | "base_uri": "https://localhost:8080/", 515 | "height": 208 516 | }, 517 | "outputId": "5365cd7a-611d-45e4-c15f-d67e2baabf4a" 518 | }, 519 | "source": [ 520 | "!wget https://s116.123apps.com/aconv/d/s116akdR1hiH_mp3_8sw6gtZb.wav" 521 | ], 522 | "execution_count": 10, 523 | "outputs": [ 524 | { 525 | "output_type": "stream", 526 | "text": [ 527 | "--2020-07-23 17:21:56-- https://s116.123apps.com/aconv/d/s116akdR1hiH_mp3_8sw6gtZb.wav\n", 528 | "Resolving s116.123apps.com (s116.123apps.com)... 78.46.41.119\n", 529 | "Connecting to s116.123apps.com (s116.123apps.com)|78.46.41.119|:443... connected.\n", 530 | "HTTP request sent, awaiting response... 200 OK\n", 531 | "Length: 41038098 (39M) [application/octet-stream]\n", 532 | "Saving to: ‘s116akdR1hiH_mp3_8sw6gtZb.wav’\n", 533 | "\n", 534 | "s116akdR1hiH_mp3_8s 100%[===================>] 39.14M 18.7MB/s in 2.1s \n", 535 | "\n", 536 | "2020-07-23 17:21:59 (18.7 MB/s) - ‘s116akdR1hiH_mp3_8sw6gtZb.wav’ saved [41038098/41038098]\n", 537 | "\n" 538 | ], 539 | "name": "stdout" 540 | } 541 | ] 542 | }, 543 | { 544 | "cell_type": "code", 545 | "metadata": { 546 | "id": "8zyE-BPEsmSH", 547 | "colab_type": "code", 548 | "colab": {} 549 | }, 550 | "source": [ 551 | "!mv s116akdR1hiH_mp3_8sw6gtZb.wav audio.wav" 552 | ], 553 | "execution_count": 11, 554 | "outputs": [] 555 | }, 556 | { 557 | "cell_type": "code", 558 | "metadata": { 559 | "id": "o60uF0ujspXi", 560 | "colab_type": "code", 561 | "colab": {} 562 | }, 563 | "source": [ 564 | "" 565 | ], 566 | "execution_count": null, 567 | "outputs": [] 568 | }, 569 | { 570 | "cell_type": "code", 571 | "metadata": { 572 | "id": "MDqlUFJc-Lks", 573 | "colab_type": "code", 574 | "colab": { 575 | "base_uri": "https://localhost:8080/", 576 | "height": 208 577 | }, 578 | "outputId": "57198393-584b-4f42-e4de-63c328f66e8a" 579 | }, 580 | "source": [ 581 | "#!wget https://s116.123apps.com/aconv/d/s1160eNbEElT_mp3_5MjyKRtz.wav #ritika sighn" 582 | ], 583 | "execution_count": 18, 584 | "outputs": [ 585 | { 586 | "output_type": "stream", 587 | "text": [ 588 | "--2020-07-23 17:32:40-- https://s116.123apps.com/aconv/d/s1160eNbEElT_mp3_5MjyKRtz.wav\n", 589 | "Resolving s116.123apps.com (s116.123apps.com)... 78.46.41.119\n", 590 | "Connecting to s116.123apps.com (s116.123apps.com)|78.46.41.119|:443... connected.\n", 591 | "HTTP request sent, awaiting response... 200 OK\n", 592 | "Length: 63186594 (60M) [application/octet-stream]\n", 593 | "Saving to: ‘s1160eNbEElT_mp3_5MjyKRtz.wav’\n", 594 | "\n", 595 | "s1160eNbEElT_mp3_5M 100%[===================>] 60.26M 20.5MB/s in 2.9s \n", 596 | "\n", 597 | "2020-07-23 17:32:43 (20.5 MB/s) - ‘s1160eNbEElT_mp3_5MjyKRtz.wav’ saved [63186594/63186594]\n", 598 | "\n" 599 | ], 600 | "name": "stdout" 601 | } 602 | ] 603 | }, 604 | { 605 | "cell_type": "code", 606 | "metadata": { 607 | "id": "TJrZchtX5a0u", 608 | "colab_type": "code", 609 | "colab": {} 610 | }, 611 | "source": [ 612 | "# !mv s1160eNbEElT_mp3_5MjyKRtz.wav audio.wav" 613 | ], 614 | "execution_count": 19, 615 | "outputs": [] 616 | }, 617 | { 618 | "cell_type": "code", 619 | "metadata": { 620 | "id": "lThNu3X565OZ", 621 | "colab_type": "code", 622 | "colab": { 623 | "base_uri": "https://localhost:8080/", 624 | "height": 34 625 | }, 626 | "outputId": "60d72273-6077-4bb1-b949-51ceca06c18b" 627 | }, 628 | "source": [ 629 | "#!ls -sh audio.wav " 630 | ], 631 | "execution_count": null, 632 | "outputs": [ 633 | { 634 | "output_type": "stream", 635 | "text": [ 636 | "59M audio.wav\n" 637 | ], 638 | "name": "stdout" 639 | } 640 | ] 641 | }, 642 | { 643 | "cell_type": "code", 644 | "metadata": { 645 | "id": "iwOqt8rlr-J1", 646 | "colab_type": "code", 647 | "colab": { 648 | "base_uri": "https://localhost:8080/", 649 | "height": 208 650 | }, 651 | "outputId": "a75d22e1-7f3a-479f-e4bf-450097ce8876" 652 | }, 653 | "source": [ 654 | "#!wget https://s108.123apps.com/aconv/d/s1087NkuYeUT_mp3_oA9lZiiF.wav #rohan sharavan" 655 | ], 656 | "execution_count": 22, 657 | "outputs": [ 658 | { 659 | "output_type": "stream", 660 | "text": [ 661 | "--2020-07-23 17:42:12-- https://s108.123apps.com/aconv/d/s1087NkuYeUT_mp3_oA9lZiiF.wav\n", 662 | "Resolving s108.123apps.com (s108.123apps.com)... 88.99.96.46\n", 663 | "Connecting to s108.123apps.com (s108.123apps.com)|88.99.96.46|:443... connected.\n", 664 | "HTTP request sent, awaiting response... 200 OK\n", 665 | "Length: 136983718 (131M) [application/octet-stream]\n", 666 | "Saving to: ‘s1087NkuYeUT_mp3_oA9lZiiF.wav’\n", 667 | "\n", 668 | "s1087NkuYeUT_mp3_oA 100%[===================>] 130.64M 25.3MB/s in 5.7s \n", 669 | "\n", 670 | "2020-07-23 17:42:18 (22.9 MB/s) - ‘s1087NkuYeUT_mp3_oA9lZiiF.wav’ saved [136983718/136983718]\n", 671 | "\n" 672 | ], 673 | "name": "stdout" 674 | } 675 | ] 676 | }, 677 | { 678 | "cell_type": "code", 679 | "metadata": { 680 | "id": "eYtkV46IxMpq", 681 | "colab_type": "code", 682 | "colab": {} 683 | }, 684 | "source": [ 685 | "#!mv s1087NkuYeUT_mp3_oA9lZiiF.wav audio.wav" 686 | ], 687 | "execution_count": 23, 688 | "outputs": [] 689 | }, 690 | { 691 | "cell_type": "markdown", 692 | "metadata": { 693 | "id": "7tz-uw42sAHO", 694 | "colab_type": "text" 695 | }, 696 | "source": [ 697 | "# Instruction \n", 698 | "when u run below cell it will ask you to click \"start recording\" . Please click it and wait for some time speak some thing to it . after 20 or 30seconds it will give u outputs . ( both male and female voices supported)" 699 | ] 700 | }, 701 | { 702 | "cell_type": "code", 703 | "metadata": { 704 | "id": "xh74tIRBqcYf", 705 | "colab_type": "code", 706 | "colab": {} 707 | }, 708 | "source": [ 709 | "# please add within 12 words .. and if u want to generate more save the generated audio in another name and then generate another audio" 710 | ], 711 | "execution_count": null, 712 | "outputs": [] 713 | }, 714 | { 715 | "cell_type": "code", 716 | "metadata": { 717 | "id": "7TjzdEmv23pl", 718 | "colab_type": "code", 719 | "colab": { 720 | "base_uri": "https://localhost:8080/", 721 | "height": 69 722 | }, 723 | "outputId": "d35ead7d-2372-44bc-bcb8-4385e1f5253a" 724 | }, 725 | "source": [ 726 | "def synth():\n", 727 | " text = \"Thank you Elon musk Thank you Steve jobs Thanks Narendra Modi Have a good day\" #@param {type:\"string\"}\n", 728 | " print(\"Now recording for 10 seconds, say what you will...\")\n", 729 | " \n", 730 | " ### record\n", 731 | " # record(30)\n", 732 | " # print(\"Audio recording complete\")\n", 733 | " in_fpath = Path(\"audio.wav\")\n", 734 | " reprocessed_wav = encoder.preprocess_wav(in_fpath)\n", 735 | " original_wav, sampling_rate = librosa.load(in_fpath)\n", 736 | " preprocessed_wav = encoder.preprocess_wav(original_wav, sampling_rate)\n", 737 | " embed = encoder.embed_utterance(preprocessed_wav)\n", 738 | " print(\"Synthesizing new audio...\")\n", 739 | " with io.capture_output() as captured:\n", 740 | " specs = synthesizer.synthesize_spectrograms([text], [embed])\n", 741 | " generated_wav = vocoder.infer_waveform(specs[0])\n", 742 | " generated_wav = np.pad(generated_wav, (0, synthesizer.sample_rate), mode=\"constant\")\n", 743 | " display(Audio(generated_wav, rate=synthesizer.sample_rate))\n", 744 | "#InvokeButton('Start recording', synth)\n", 745 | "synth()" 746 | ], 747 | "execution_count": null, 748 | "outputs": [ 749 | { 750 | "output_type": "stream", 751 | "text": [ 752 | "Now recording for 10 seconds, say what you will...\n", 753 | "Synthesizing new audio...\n", 754 | "{| ███████████████░ 78300/86400 | Batch Size: 9 | Gen Rate: 6.3kHz | }" 755 | ], 756 | "name": "stdout" 757 | } 758 | ] 759 | }, 760 | { 761 | "cell_type": "code", 762 | "metadata": { 763 | "id": "aEZMA-cd2v_m", 764 | "colab_type": "code", 765 | "colab": {} 766 | }, 767 | "source": [ 768 | "" 769 | ], 770 | "execution_count": null, 771 | "outputs": [] 772 | }, 773 | { 774 | "cell_type": "code", 775 | "metadata": { 776 | "id": "40Az5h-F2wNc", 777 | "colab_type": "code", 778 | "colab": {} 779 | }, 780 | "source": [ 781 | "" 782 | ], 783 | "execution_count": null, 784 | "outputs": [] 785 | }, 786 | { 787 | "cell_type": "code", 788 | "metadata": { 789 | "id": "GWK0D9aU2wbQ", 790 | "colab_type": "code", 791 | "colab": {} 792 | }, 793 | "source": [ 794 | "" 795 | ], 796 | "execution_count": null, 797 | "outputs": [] 798 | }, 799 | { 800 | "cell_type": "code", 801 | "metadata": { 802 | "id": "uaBbVJCs2wp6", 803 | "colab_type": "code", 804 | "colab": {} 805 | }, 806 | "source": [ 807 | "" 808 | ], 809 | "execution_count": null, 810 | "outputs": [] 811 | }, 812 | { 813 | "cell_type": "code", 814 | "metadata": { 815 | "id": "qWyj8ZKQ2w2F", 816 | "colab_type": "code", 817 | "colab": {} 818 | }, 819 | "source": [ 820 | "" 821 | ], 822 | "execution_count": null, 823 | "outputs": [] 824 | }, 825 | { 826 | "cell_type": "code", 827 | "metadata": { 828 | "id": "gqotncdy2cgW", 829 | "colab_type": "code", 830 | "colab": {} 831 | }, 832 | "source": [ 833 | "" 834 | ], 835 | "execution_count": null, 836 | "outputs": [] 837 | }, 838 | { 839 | "cell_type": "code", 840 | "metadata": { 841 | "id": "dIcesKx42crM", 842 | "colab_type": "code", 843 | "colab": {} 844 | }, 845 | "source": [ 846 | "" 847 | ], 848 | "execution_count": null, 849 | "outputs": [] 850 | }, 851 | { 852 | "cell_type": "code", 853 | "metadata": { 854 | "id": "BAQXJcch2c3Z", 855 | "colab_type": "code", 856 | "colab": {} 857 | }, 858 | "source": [ 859 | "" 860 | ], 861 | "execution_count": null, 862 | "outputs": [] 863 | } 864 | ] 865 | } -------------------------------------------------------------------------------- /Deep_Fakes_for_Video_Colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Deep Fakes for Video - Colab", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "accelerator": "GPU" 14 | }, 15 | "cells": [ 16 | { 17 | "cell_type": "code", 18 | "metadata": { 19 | "id": "owlpZIs9tBC4", 20 | "colab_type": "code", 21 | "colab": {} 22 | }, 23 | "source": [ 24 | "#https://towardsdatascience.com/how-to-produce-a-deepfake-video-in-5-minutes-513984fd24b6" 25 | ], 26 | "execution_count": null, 27 | "outputs": [] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "metadata": { 32 | "id": "sRVjV1XSm66-", 33 | "colab_type": "code", 34 | "colab": { 35 | "base_uri": "https://localhost:8080/", 36 | "height": 1000 37 | }, 38 | "outputId": "71ec3d4b-7aa6-4dd5-f393-1a7b9082a032" 39 | }, 40 | "source": [ 41 | "!pip install deep-animator" 42 | ], 43 | "execution_count": 1, 44 | "outputs": [ 45 | { 46 | "output_type": "stream", 47 | "text": [ 48 | "Collecting deep-animator\n", 49 | " Downloading https://files.pythonhosted.org/packages/04/83/5d1d442429d5b4f02d58516f28c716a1aa8b42a9f017a929713529da02fa/deep_animator-0.1.1-py3-none-any.whl\n", 50 | "Collecting scipy==1.1.0\n", 51 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/a8/0b/f163da98d3a01b3e0ef1cab8dd2123c34aee2bafbb1c5bffa354cc8a1730/scipy-1.1.0-cp36-cp36m-manylinux1_x86_64.whl (31.2MB)\n", 52 | "\u001b[K |████████████████████████████████| 31.2MB 102kB/s \n", 53 | "\u001b[?25hCollecting scikit-image==0.14.0\n", 54 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/34/79/cefff573a53ca3fb4c390739d19541b95f371e24d2990aed4cd8837971f0/scikit_image-0.14.0-cp36-cp36m-manylinux1_x86_64.whl (25.3MB)\n", 55 | "\u001b[K |████████████████████████████████| 25.3MB 130kB/s \n", 56 | "\u001b[?25hRequirement already satisfied: torchvision>=0.2.1 in /usr/local/lib/python3.6/dist-packages (from deep-animator) (0.6.1+cu101)\n", 57 | "Requirement already satisfied: torch>=1.3.0 in /usr/local/lib/python3.6/dist-packages (from deep-animator) (1.5.1+cu101)\n", 58 | "Collecting scikit-learn==0.19.2\n", 59 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/f9/c8/8db4108aba5e2166cd2ea4eafa1a4b82f89240a1fa85733029cc2358ad1f/scikit_learn-0.19.2-cp36-cp36m-manylinux1_x86_64.whl (4.9MB)\n", 60 | "\u001b[K |████████████████████████████████| 4.9MB 59.0MB/s \n", 61 | "\u001b[?25hCollecting ffmpeg\n", 62 | " Downloading https://files.pythonhosted.org/packages/f0/cc/3b7408b8ecf7c1d20ad480c3eaed7619857bf1054b690226e906fdf14258/ffmpeg-1.4.tar.gz\n", 63 | "Collecting numpy==1.15.0\n", 64 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/88/29/f4c845648ed23264e986cdc5fbab5f8eace1be5e62144ef69ccc7189461d/numpy-1.15.0-cp36-cp36m-manylinux1_x86_64.whl (13.9MB)\n", 65 | "\u001b[K |████████████████████████████████| 13.9MB 240kB/s \n", 66 | "\u001b[?25hCollecting pandas==0.23.4\n", 67 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/e1/d8/feeb346d41f181e83fba45224ab14a8d8af019b48af742e047f3845d8cff/pandas-0.23.4-cp36-cp36m-manylinux1_x86_64.whl (8.9MB)\n", 68 | "\u001b[K |████████████████████████████████| 8.9MB 48.4MB/s \n", 69 | "\u001b[?25hCollecting fire\n", 70 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/34/a7/0e22e70778aca01a52b9c899d9c145c6396d7b613719cd63db97ffa13f2f/fire-0.3.1.tar.gz (81kB)\n", 71 | "\u001b[K |████████████████████████████████| 81kB 10.4MB/s \n", 72 | "\u001b[?25hCollecting imageio==2.3.0\n", 73 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/a7/1d/33c8686072148b3b0fcc12a2e0857dd8316b8ae20a0fa66c8d6a6d01c05c/imageio-2.3.0-py2.py3-none-any.whl (3.3MB)\n", 74 | "\u001b[K |████████████████████████████████| 3.3MB 56.5MB/s \n", 75 | "\u001b[?25hRequirement already satisfied: tqdm in /usr/local/lib/python3.6/dist-packages (from deep-animator) (4.41.1)\n", 76 | "Collecting matplotlib==2.2.2\n", 77 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/49/b8/89dbd27f2fb171ce753bb56220d4d4f6dbc5fe32b95d8edc4415782ef07f/matplotlib-2.2.2-cp36-cp36m-manylinux1_x86_64.whl (12.6MB)\n", 78 | "\u001b[K |████████████████████████████████| 12.6MB 246kB/s \n", 79 | "\u001b[?25hCollecting Pillow==5.2.0\n", 80 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/d1/24/f53ff6b61b3d728b90934bddb4f03f8ab584a7f49299bf3bde56e2952612/Pillow-5.2.0-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)\n", 81 | "\u001b[K |████████████████████████████████| 2.0MB 48.5MB/s \n", 82 | "\u001b[?25hRequirement already satisfied: PyWavelets>=0.4.0 in /usr/local/lib/python3.6/dist-packages (from scikit-image==0.14.0->deep-animator) (1.1.1)\n", 83 | "Requirement already satisfied: dask[array]>=0.9.0 in /usr/local/lib/python3.6/dist-packages (from scikit-image==0.14.0->deep-animator) (2.12.0)\n", 84 | "Requirement already satisfied: networkx>=1.8 in /usr/local/lib/python3.6/dist-packages (from scikit-image==0.14.0->deep-animator) (2.4)\n", 85 | "Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from scikit-image==0.14.0->deep-animator) (1.15.0)\n", 86 | "Requirement already satisfied: cloudpickle>=0.2.1 in /usr/local/lib/python3.6/dist-packages (from scikit-image==0.14.0->deep-animator) (1.3.0)\n", 87 | "Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from torch>=1.3.0->deep-animator) (0.16.0)\n", 88 | "Requirement already satisfied: pytz>=2011k in /usr/local/lib/python3.6/dist-packages (from pandas==0.23.4->deep-animator) (2018.9)\n", 89 | "Requirement already satisfied: python-dateutil>=2.5.0 in /usr/local/lib/python3.6/dist-packages (from pandas==0.23.4->deep-animator) (2.8.1)\n", 90 | "Requirement already satisfied: termcolor in /usr/local/lib/python3.6/dist-packages (from fire->deep-animator) (1.1.0)\n", 91 | "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib==2.2.2->deep-animator) (2.4.7)\n", 92 | "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib==2.2.2->deep-animator) (1.2.0)\n", 93 | "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib==2.2.2->deep-animator) (0.10.0)\n", 94 | "Requirement already satisfied: toolz>=0.7.3; extra == \"array\" in /usr/local/lib/python3.6/dist-packages (from dask[array]>=0.9.0->scikit-image==0.14.0->deep-animator) (0.10.0)\n", 95 | "Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.6/dist-packages (from networkx>=1.8->scikit-image==0.14.0->deep-animator) (4.4.2)\n", 96 | "Building wheels for collected packages: ffmpeg, fire\n", 97 | " Building wheel for ffmpeg (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 98 | " Created wheel for ffmpeg: filename=ffmpeg-1.4-cp36-none-any.whl size=6084 sha256=d3d757a82ef096974f36950a5f112f4b2fd61dd6c19847c387216755e0fa8ce7\n", 99 | " Stored in directory: /root/.cache/pip/wheels/b6/68/c3/a05a35f647ba871e5572b9bbfc0b95fd1c6637a2219f959e7a\n", 100 | " Building wheel for fire (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 101 | " Created wheel for fire: filename=fire-0.3.1-py2.py3-none-any.whl size=111005 sha256=0ac9850f8eb6e38b92f76272f3254dd430dc807a9e6e97d022feea811afa843d\n", 102 | " Stored in directory: /root/.cache/pip/wheels/c1/61/df/768b03527bf006b546dce284eb4249b185669e65afc5fbb2ac\n", 103 | "Successfully built ffmpeg fire\n", 104 | "\u001b[31mERROR: yellowbrick 0.9.1 has requirement scikit-learn>=0.20, but you'll have scikit-learn 0.19.2 which is incompatible.\u001b[0m\n", 105 | "\u001b[31mERROR: xarray 0.15.1 has requirement pandas>=0.25, but you'll have pandas 0.23.4 which is incompatible.\u001b[0m\n", 106 | "\u001b[31mERROR: umap-learn 0.4.6 has requirement numpy>=1.17, but you'll have numpy 1.15.0 which is incompatible.\u001b[0m\n", 107 | "\u001b[31mERROR: umap-learn 0.4.6 has requirement scikit-learn>=0.20, but you'll have scikit-learn 0.19.2 which is incompatible.\u001b[0m\n", 108 | "\u001b[31mERROR: umap-learn 0.4.6 has requirement scipy>=1.3.1, but you'll have scipy 1.1.0 which is incompatible.\u001b[0m\n", 109 | "\u001b[31mERROR: tifffile 2020.7.17 has requirement numpy>=1.15.1, but you'll have numpy 1.15.0 which is incompatible.\u001b[0m\n", 110 | "\u001b[31mERROR: tensorflow 2.2.0 has requirement numpy<2.0,>=1.16.0, but you'll have numpy 1.15.0 which is incompatible.\u001b[0m\n", 111 | "\u001b[31mERROR: tensorflow 2.2.0 has requirement scipy==1.4.1; python_version >= \"3\", but you'll have scipy 1.1.0 which is incompatible.\u001b[0m\n", 112 | "\u001b[31mERROR: plotnine 0.6.0 has requirement matplotlib>=3.1.1, but you'll have matplotlib 2.2.2 which is incompatible.\u001b[0m\n", 113 | "\u001b[31mERROR: plotnine 0.6.0 has requirement numpy>=1.16.0, but you'll have numpy 1.15.0 which is incompatible.\u001b[0m\n", 114 | "\u001b[31mERROR: plotnine 0.6.0 has requirement pandas>=0.25.0, but you'll have pandas 0.23.4 which is incompatible.\u001b[0m\n", 115 | "\u001b[31mERROR: plotnine 0.6.0 has requirement scipy>=1.2.0, but you'll have scipy 1.1.0 which is incompatible.\u001b[0m\n", 116 | "\u001b[31mERROR: mizani 0.6.0 has requirement matplotlib>=3.1.1, but you'll have matplotlib 2.2.2 which is incompatible.\u001b[0m\n", 117 | "\u001b[31mERROR: mizani 0.6.0 has requirement pandas>=0.25.0, but you'll have pandas 0.23.4 which is incompatible.\u001b[0m\n", 118 | "\u001b[31mERROR: imbalanced-learn 0.4.3 has requirement scikit-learn>=0.20, but you'll have scikit-learn 0.19.2 which is incompatible.\u001b[0m\n", 119 | "\u001b[31mERROR: google-colab 1.0.0 has requirement pandas~=1.0.0; python_version >= \"3.0\", but you'll have pandas 0.23.4 which is incompatible.\u001b[0m\n", 120 | "\u001b[31mERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.\u001b[0m\n", 121 | "\u001b[31mERROR: astropy 4.0.1.post1 has requirement numpy>=1.16, but you'll have numpy 1.15.0 which is incompatible.\u001b[0m\n", 122 | "\u001b[31mERROR: albumentations 0.1.12 has requirement imgaug<0.2.7,>=0.2.5, but you'll have imgaug 0.2.9 which is incompatible.\u001b[0m\n", 123 | "Installing collected packages: numpy, scipy, Pillow, matplotlib, scikit-image, scikit-learn, ffmpeg, pandas, fire, imageio, deep-animator\n", 124 | " Found existing installation: numpy 1.18.5\n", 125 | " Uninstalling numpy-1.18.5:\n", 126 | " Successfully uninstalled numpy-1.18.5\n", 127 | " Found existing installation: scipy 1.4.1\n", 128 | " Uninstalling scipy-1.4.1:\n", 129 | " Successfully uninstalled scipy-1.4.1\n", 130 | " Found existing installation: Pillow 7.0.0\n", 131 | " Uninstalling Pillow-7.0.0:\n", 132 | " Successfully uninstalled Pillow-7.0.0\n", 133 | " Found existing installation: matplotlib 3.2.2\n", 134 | " Uninstalling matplotlib-3.2.2:\n", 135 | " Successfully uninstalled matplotlib-3.2.2\n", 136 | " Found existing installation: scikit-image 0.16.2\n", 137 | " Uninstalling scikit-image-0.16.2:\n", 138 | " Successfully uninstalled scikit-image-0.16.2\n", 139 | " Found existing installation: scikit-learn 0.22.2.post1\n", 140 | " Uninstalling scikit-learn-0.22.2.post1:\n", 141 | " Successfully uninstalled scikit-learn-0.22.2.post1\n", 142 | " Found existing installation: pandas 1.0.5\n", 143 | " Uninstalling pandas-1.0.5:\n", 144 | " Successfully uninstalled pandas-1.0.5\n", 145 | " Found existing installation: imageio 2.4.1\n", 146 | " Uninstalling imageio-2.4.1:\n", 147 | " Successfully uninstalled imageio-2.4.1\n", 148 | "Successfully installed Pillow-5.2.0 deep-animator-0.1.1 ffmpeg-1.4 fire-0.3.1 imageio-2.3.0 matplotlib-2.2.2 numpy-1.15.0 pandas-0.23.4 scikit-image-0.14.0 scikit-learn-0.19.2 scipy-1.1.0\n" 149 | ], 150 | "name": "stdout" 151 | }, 152 | { 153 | "output_type": "display_data", 154 | "data": { 155 | "application/vnd.colab-display-data+json": { 156 | "pip_warning": { 157 | "packages": [ 158 | "PIL", 159 | "matplotlib", 160 | "mpl_toolkits", 161 | "numpy", 162 | "pandas" 163 | ] 164 | } 165 | } 166 | }, 167 | "metadata": { 168 | "tags": [] 169 | } 170 | } 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "metadata": { 176 | "id": "PC3yhAOeo8N3", 177 | "colab_type": "code", 178 | "colab": { 179 | "base_uri": "https://localhost:8080/", 180 | "height": 453 181 | }, 182 | "outputId": "efa7379f-785a-4fa1-cbf6-117a5b336e91" 183 | }, 184 | "source": [ 185 | "!wget --load-cookies /tmp/cookies.txt \"https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1zqa0la8FKchq62gRJMMvDGVhinf3nBEx' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\\1\\n/p')&id=1zqa0la8FKchq62gRJMMvDGVhinf3nBEx\" -O vox-cpk.pth.tar && rm -rf /tmp/cookies.txt" 186 | ], 187 | "execution_count": 2, 188 | "outputs": [ 189 | { 190 | "output_type": "stream", 191 | "text": [ 192 | "--2020-07-23 16:07:00-- https://docs.google.com/uc?export=download&confirm=JG9T&id=1zqa0la8FKchq62gRJMMvDGVhinf3nBEx\n", 193 | "Resolving docs.google.com (docs.google.com)... 173.194.79.101, 173.194.79.138, 173.194.79.100, ...\n", 194 | "Connecting to docs.google.com (docs.google.com)|173.194.79.101|:443... connected.\n", 195 | "HTTP request sent, awaiting response... 302 Moved Temporarily\n", 196 | "Location: https://doc-0s-bk-docs.googleusercontent.com/docs/securesc/hot3k07n844j43fube8rv03ci2j4gm00/95mfdrnf7025fa715elrh4j229c73mh5/1595520375000/13181020734625639142/08142092822084139008Z/1zqa0la8FKchq62gRJMMvDGVhinf3nBEx?e=download [following]\n", 197 | "--2020-07-23 16:07:00-- https://doc-0s-bk-docs.googleusercontent.com/docs/securesc/hot3k07n844j43fube8rv03ci2j4gm00/95mfdrnf7025fa715elrh4j229c73mh5/1595520375000/13181020734625639142/08142092822084139008Z/1zqa0la8FKchq62gRJMMvDGVhinf3nBEx?e=download\n", 198 | "Resolving doc-0s-bk-docs.googleusercontent.com (doc-0s-bk-docs.googleusercontent.com)... 108.177.127.132, 2a00:1450:4013:c07::84\n", 199 | "Connecting to doc-0s-bk-docs.googleusercontent.com (doc-0s-bk-docs.googleusercontent.com)|108.177.127.132|:443... connected.\n", 200 | "HTTP request sent, awaiting response... 302 Found\n", 201 | "Location: https://docs.google.com/nonceSigner?nonce=0ondloaf0mqrg&continue=https://doc-0s-bk-docs.googleusercontent.com/docs/securesc/hot3k07n844j43fube8rv03ci2j4gm00/95mfdrnf7025fa715elrh4j229c73mh5/1595520375000/13181020734625639142/08142092822084139008Z/1zqa0la8FKchq62gRJMMvDGVhinf3nBEx?e%3Ddownload&hash=bqs6bq511ljd4ik3pjum1o09l5idpmve [following]\n", 202 | "--2020-07-23 16:07:00-- https://docs.google.com/nonceSigner?nonce=0ondloaf0mqrg&continue=https://doc-0s-bk-docs.googleusercontent.com/docs/securesc/hot3k07n844j43fube8rv03ci2j4gm00/95mfdrnf7025fa715elrh4j229c73mh5/1595520375000/13181020734625639142/08142092822084139008Z/1zqa0la8FKchq62gRJMMvDGVhinf3nBEx?e%3Ddownload&hash=bqs6bq511ljd4ik3pjum1o09l5idpmve\n", 203 | "Connecting to docs.google.com (docs.google.com)|173.194.79.101|:443... connected.\n", 204 | "HTTP request sent, awaiting response... 302 Found\n", 205 | "Location: https://doc-0s-bk-docs.googleusercontent.com/docs/securesc/hot3k07n844j43fube8rv03ci2j4gm00/95mfdrnf7025fa715elrh4j229c73mh5/1595520375000/13181020734625639142/08142092822084139008Z/1zqa0la8FKchq62gRJMMvDGVhinf3nBEx?e=download&nonce=0ondloaf0mqrg&user=08142092822084139008Z&hash=9973813cthnu1efc7589ndn5n60j8k7c [following]\n", 206 | "--2020-07-23 16:07:00-- https://doc-0s-bk-docs.googleusercontent.com/docs/securesc/hot3k07n844j43fube8rv03ci2j4gm00/95mfdrnf7025fa715elrh4j229c73mh5/1595520375000/13181020734625639142/08142092822084139008Z/1zqa0la8FKchq62gRJMMvDGVhinf3nBEx?e=download&nonce=0ondloaf0mqrg&user=08142092822084139008Z&hash=9973813cthnu1efc7589ndn5n60j8k7c\n", 207 | "Connecting to doc-0s-bk-docs.googleusercontent.com (doc-0s-bk-docs.googleusercontent.com)|108.177.127.132|:443... connected.\n", 208 | "HTTP request sent, awaiting response... 200 OK\n", 209 | "Length: unspecified [application/x-tar]\n", 210 | "Saving to: ‘vox-cpk.pth.tar’\n", 211 | "\n", 212 | "vox-cpk.pth.tar [ <=> ] 695.01M 58.5MB/s in 12s \n", 213 | "\n", 214 | "2020-07-23 16:07:13 (57.5 MB/s) - ‘vox-cpk.pth.tar’ saved [728766691]\n", 215 | "\n" 216 | ], 217 | "name": "stdout" 218 | } 219 | ] 220 | }, 221 | { 222 | "cell_type": "code", 223 | "metadata": { 224 | "id": "WudNsukLrqcf", 225 | "colab_type": "code", 226 | "colab": { 227 | "base_uri": "https://localhost:8080/", 228 | "height": 34 229 | }, 230 | "outputId": "1e4350d8-abd6-4a8b-c021-ed6ed1bbb7d2" 231 | }, 232 | "source": [ 233 | "!ls" 234 | ], 235 | "execution_count": 1, 236 | "outputs": [ 237 | { 238 | "output_type": "stream", 239 | "text": [ 240 | "sample_data vox-cpk.pth.tar\n" 241 | ], 242 | "name": "stdout" 243 | } 244 | ] 245 | }, 246 | { 247 | "cell_type": "code", 248 | "metadata": { 249 | "id": "F5otCHCDpdyH", 250 | "colab_type": "code", 251 | "colab": { 252 | "base_uri": "https://localhost:8080/", 253 | "height": 453 254 | }, 255 | "outputId": "b4df4853-1944-4aee-a7a9-7073b75308f6" 256 | }, 257 | "source": [ 258 | "!wget --load-cookies /tmp/cookies.txt \"https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\\1\\n/p')&id=103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D\" -O \"00.mp4\" && rm -rf /tmp/cookies.txt" 259 | ], 260 | "execution_count": 2, 261 | "outputs": [ 262 | { 263 | "output_type": "stream", 264 | "text": [ 265 | "--2020-07-23 16:08:26-- https://docs.google.com/uc?export=download&confirm=&id=103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D\n", 266 | "Resolving docs.google.com (docs.google.com)... 172.217.218.102, 172.217.218.139, 172.217.218.100, ...\n", 267 | "Connecting to docs.google.com (docs.google.com)|172.217.218.102|:443... connected.\n", 268 | "HTTP request sent, awaiting response... 302 Moved Temporarily\n", 269 | "Location: https://doc-0o-9g-docs.googleusercontent.com/docs/securesc/tgrbiil4mh3ks4j6h9qcbdipiunanqbg/n26o68i8hk48jpu83vt96alt8u538431/1595520450000/13181020734625639142/02930570254634000981Z/103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D?e=download [following]\n", 270 | "--2020-07-23 16:08:26-- https://doc-0o-9g-docs.googleusercontent.com/docs/securesc/tgrbiil4mh3ks4j6h9qcbdipiunanqbg/n26o68i8hk48jpu83vt96alt8u538431/1595520450000/13181020734625639142/02930570254634000981Z/103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D?e=download\n", 271 | "Resolving doc-0o-9g-docs.googleusercontent.com (doc-0o-9g-docs.googleusercontent.com)... 108.177.127.132, 2a00:1450:4013:c07::84\n", 272 | "Connecting to doc-0o-9g-docs.googleusercontent.com (doc-0o-9g-docs.googleusercontent.com)|108.177.127.132|:443... connected.\n", 273 | "HTTP request sent, awaiting response... 302 Found\n", 274 | "Location: https://docs.google.com/nonceSigner?nonce=h7tg0vs6bveic&continue=https://doc-0o-9g-docs.googleusercontent.com/docs/securesc/tgrbiil4mh3ks4j6h9qcbdipiunanqbg/n26o68i8hk48jpu83vt96alt8u538431/1595520450000/13181020734625639142/02930570254634000981Z/103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D?e%3Ddownload&hash=p5s5tcibo5048mldnqcumbcbjocenu4b [following]\n", 275 | "--2020-07-23 16:08:26-- https://docs.google.com/nonceSigner?nonce=h7tg0vs6bveic&continue=https://doc-0o-9g-docs.googleusercontent.com/docs/securesc/tgrbiil4mh3ks4j6h9qcbdipiunanqbg/n26o68i8hk48jpu83vt96alt8u538431/1595520450000/13181020734625639142/02930570254634000981Z/103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D?e%3Ddownload&hash=p5s5tcibo5048mldnqcumbcbjocenu4b\n", 276 | "Connecting to docs.google.com (docs.google.com)|172.217.218.102|:443... connected.\n", 277 | "HTTP request sent, awaiting response... 302 Found\n", 278 | "Location: https://doc-0o-9g-docs.googleusercontent.com/docs/securesc/tgrbiil4mh3ks4j6h9qcbdipiunanqbg/n26o68i8hk48jpu83vt96alt8u538431/1595520450000/13181020734625639142/02930570254634000981Z/103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D?e=download&nonce=h7tg0vs6bveic&user=02930570254634000981Z&hash=t2mdqvcdvgbn1p29d7pmdviota9jii44 [following]\n", 279 | "--2020-07-23 16:08:26-- https://doc-0o-9g-docs.googleusercontent.com/docs/securesc/tgrbiil4mh3ks4j6h9qcbdipiunanqbg/n26o68i8hk48jpu83vt96alt8u538431/1595520450000/13181020734625639142/02930570254634000981Z/103PEtO2QO45XwCNLYIzMcW3aRdbOhS1D?e=download&nonce=h7tg0vs6bveic&user=02930570254634000981Z&hash=t2mdqvcdvgbn1p29d7pmdviota9jii44\n", 280 | "Connecting to doc-0o-9g-docs.googleusercontent.com (doc-0o-9g-docs.googleusercontent.com)|108.177.127.132|:443... connected.\n", 281 | "HTTP request sent, awaiting response... 200 OK\n", 282 | "Length: 170054 (166K) [video/mp4]\n", 283 | "Saving to: ‘00.mp4’\n", 284 | "\n", 285 | "00.mp4 100%[===================>] 166.07K --.-KB/s in 0.001s \n", 286 | "\n", 287 | "2020-07-23 16:08:26 (149 MB/s) - ‘00.mp4’ saved [170054/170054]\n", 288 | "\n" 289 | ], 290 | "name": "stdout" 291 | } 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "metadata": { 297 | "id": "eKs1jO7Tppbk", 298 | "colab_type": "code", 299 | "colab": { 300 | "base_uri": "https://localhost:8080/", 301 | "height": 453 302 | }, 303 | "outputId": "5d6e0e11-520c-48e4-d3f6-32819add37d9" 304 | }, 305 | "source": [ 306 | "!wget --load-cookies /tmp/cookies.txt \"https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\\1\\n/p')&id=1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR\" -O \"00.png\" && rm -rf /tmp/cookies.txt" 307 | ], 308 | "execution_count": 4, 309 | "outputs": [ 310 | { 311 | "output_type": "stream", 312 | "text": [ 313 | "--2020-07-23 16:09:08-- https://docs.google.com/uc?export=download&confirm=&id=1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR\n", 314 | "Resolving docs.google.com (docs.google.com)... 108.177.119.100, 108.177.119.139, 108.177.119.113, ...\n", 315 | "Connecting to docs.google.com (docs.google.com)|108.177.119.100|:443... connected.\n", 316 | "HTTP request sent, awaiting response... 302 Moved Temporarily\n", 317 | "Location: https://doc-14-2g-docs.googleusercontent.com/docs/securesc/qk001uq6jb9shos16k2bvjjbqo4csi3q/mmfl64u92256mgarhoiub0m5d7qn3s5u/1595520525000/13181020734625639142/16782195168960361258Z/1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR?e=download [following]\n", 318 | "--2020-07-23 16:09:08-- https://doc-14-2g-docs.googleusercontent.com/docs/securesc/qk001uq6jb9shos16k2bvjjbqo4csi3q/mmfl64u92256mgarhoiub0m5d7qn3s5u/1595520525000/13181020734625639142/16782195168960361258Z/1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR?e=download\n", 319 | "Resolving doc-14-2g-docs.googleusercontent.com (doc-14-2g-docs.googleusercontent.com)... 108.177.127.132, 2a00:1450:4013:c07::84\n", 320 | "Connecting to doc-14-2g-docs.googleusercontent.com (doc-14-2g-docs.googleusercontent.com)|108.177.127.132|:443... connected.\n", 321 | "HTTP request sent, awaiting response... 302 Found\n", 322 | "Location: https://docs.google.com/nonceSigner?nonce=53vs3v31p9ils&continue=https://doc-14-2g-docs.googleusercontent.com/docs/securesc/qk001uq6jb9shos16k2bvjjbqo4csi3q/mmfl64u92256mgarhoiub0m5d7qn3s5u/1595520525000/13181020734625639142/16782195168960361258Z/1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR?e%3Ddownload&hash=gueif81p89qb6eqbq9mh0213ql0o8vfp [following]\n", 323 | "--2020-07-23 16:09:08-- https://docs.google.com/nonceSigner?nonce=53vs3v31p9ils&continue=https://doc-14-2g-docs.googleusercontent.com/docs/securesc/qk001uq6jb9shos16k2bvjjbqo4csi3q/mmfl64u92256mgarhoiub0m5d7qn3s5u/1595520525000/13181020734625639142/16782195168960361258Z/1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR?e%3Ddownload&hash=gueif81p89qb6eqbq9mh0213ql0o8vfp\n", 324 | "Connecting to docs.google.com (docs.google.com)|108.177.119.100|:443... connected.\n", 325 | "HTTP request sent, awaiting response... 302 Found\n", 326 | "Location: https://doc-14-2g-docs.googleusercontent.com/docs/securesc/qk001uq6jb9shos16k2bvjjbqo4csi3q/mmfl64u92256mgarhoiub0m5d7qn3s5u/1595520525000/13181020734625639142/16782195168960361258Z/1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR?e=download&nonce=53vs3v31p9ils&user=16782195168960361258Z&hash=cnra6gaoa4ifpgb80i87f447ieabton6 [following]\n", 327 | "--2020-07-23 16:09:08-- https://doc-14-2g-docs.googleusercontent.com/docs/securesc/qk001uq6jb9shos16k2bvjjbqo4csi3q/mmfl64u92256mgarhoiub0m5d7qn3s5u/1595520525000/13181020734625639142/16782195168960361258Z/1ACSKOfQUHbSEWmPu4Ndss7bkrPVK5WBR?e=download&nonce=53vs3v31p9ils&user=16782195168960361258Z&hash=cnra6gaoa4ifpgb80i87f447ieabton6\n", 328 | "Connecting to doc-14-2g-docs.googleusercontent.com (doc-14-2g-docs.googleusercontent.com)|108.177.127.132|:443... connected.\n", 329 | "HTTP request sent, awaiting response... 200 OK\n", 330 | "Length: 45652 (45K) [image/png]\n", 331 | "Saving to: ‘00.png’\n", 332 | "\n", 333 | "00.png 100%[===================>] 44.58K --.-KB/s in 0s \n", 334 | "\n", 335 | "2020-07-23 16:09:08 (151 MB/s) - ‘00.png’ saved [45652/45652]\n", 336 | "\n" 337 | ], 338 | "name": "stdout" 339 | } 340 | ] 341 | }, 342 | { 343 | "cell_type": "code", 344 | "metadata": { 345 | "id": "Goj1-AgHp3V2", 346 | "colab_type": "code", 347 | "colab": { 348 | "base_uri": "https://localhost:8080/", 349 | "height": 34 350 | }, 351 | "outputId": "f5020401-0cbe-465e-c806-cc2188707b9e" 352 | }, 353 | "source": [ 354 | "%%writefile conf.yml\n", 355 | "\n", 356 | "model_params:\n", 357 | " common_params:\n", 358 | " num_kp: 10\n", 359 | " num_channels: 3\n", 360 | " estimate_jacobian: True\n", 361 | " kp_detector_params:\n", 362 | " temperature: 0.1\n", 363 | " block_expansion: 32\n", 364 | " max_features: 1024\n", 365 | " scale_factor: 0.25\n", 366 | " num_blocks: 5\n", 367 | " generator_params:\n", 368 | " block_expansion: 64\n", 369 | " max_features: 512\n", 370 | " num_down_blocks: 2\n", 371 | " num_bottleneck_blocks: 6\n", 372 | " estimate_occlusion_map: True\n", 373 | " dense_motion_params:\n", 374 | " block_expansion: 64\n", 375 | " max_features: 1024\n", 376 | " num_blocks: 5\n", 377 | " scale_factor: 0.25\n", 378 | " discriminator_params:\n", 379 | " scales: [1]\n", 380 | " block_expansion: 32\n", 381 | " max_features: 512\n", 382 | " num_blocks: 4" 383 | ], 384 | "execution_count": 5, 385 | "outputs": [ 386 | { 387 | "output_type": "stream", 388 | "text": [ 389 | "Writing conf.yml\n" 390 | ], 391 | "name": "stdout" 392 | } 393 | ] 394 | }, 395 | { 396 | "cell_type": "code", 397 | "metadata": { 398 | "id": "W2dmjky4qUk7", 399 | "colab_type": "code", 400 | "colab": { 401 | "base_uri": "https://localhost:8080/", 402 | "height": 52 403 | }, 404 | "outputId": "fad40fd4-606c-499b-cd85-c3c43f963e5f" 405 | }, 406 | "source": [ 407 | "!ls" 408 | ], 409 | "execution_count": null, 410 | "outputs": [ 411 | { 412 | "output_type": "stream", 413 | "text": [ 414 | " 00.mp4 conf.yml\t\t sample_data\n", 415 | " 00.png 'Copy of vox-cpk.pth.tar' vox-cpk.pth.tar\n" 416 | ], 417 | "name": "stdout" 418 | } 419 | ] 420 | }, 421 | { 422 | "cell_type": "code", 423 | "metadata": { 424 | "id": "iGnX6bIdqWn3", 425 | "colab_type": "code", 426 | "colab": {} 427 | }, 428 | "source": [ 429 | "" 430 | ], 431 | "execution_count": null, 432 | "outputs": [] 433 | }, 434 | { 435 | "cell_type": "code", 436 | "metadata": { 437 | "id": "jmobgdojLuYn", 438 | "colab_type": "code", 439 | "colab": { 440 | "resources": { 441 | "http://localhost:8080/nbextensions/google.colab/files.js": { 442 | "data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgovLyBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLy8KLy8gICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLy8KLy8gVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQovLyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAovLyBXSVRIT1VUI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cG9zaXRpb24sIE1BWF9QQVlMT0FEX1NJWkUpOwogICAgICBjb25zdCBjaHVuayA9IG5ldyBVaW50OEFycmF5KGZpbGVEYXRhLCBwb3NpdGlvbiwgbGVuZ3RoKTsKICAgICAgcG9zaXRpb24gKz0gbGVuZ3RoOwoKICAgICAgY29uc3QgYmFzZTY0ID0gYnRvYShTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIGNodW5rKSk7CiAgICAgIHlpZWxkIHsKICAgICAgICByZXNwb25zZTogewogICAgICAgICAgYWN0aW9uOiAnYXBwZW5kJywKICAgICAgICAgIGZpbGU6IGZpbGUubmFtZSwKICAgICAgICAgIGRhdGE6IGJhc2U2NCwKICAgICAgICB9LAogICAgICB9OwogICAgICBwZXJjZW50LnRleHRDb250ZW50ID0KICAgICAgICAgIGAke01hdGgucm91bmQoKHBvc2l0aW9uIC8gZmlsZURhdGEuYnl0ZUxlbmd0aCkgKiAxMDApfSUgZG9uZWA7CiAgICB9CiAgfQoKICAvLyBBbGwgZG9uZS4KICB5aWVsZCB7CiAgICByZXNwb25zZTogewogICAgICBhY3Rpb246ICdjb21wbGV0ZScsCiAgICB9CiAgfTsKfQoKc2NvcGUuZ29vZ2xlID0gc2NvcGUuZ29vZ2xlIHx8IHt9OwpzY29wZS5nb29nbGUuY29sYWIgPSBzY29wZS5nb29nbGUuY29sYWIgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYi5fZmlsZXMgPSB7CiAgX3VwbG9hZEZpbGVzLAogIF91cGxvYWRGaWxlc0NvbnRpbnVlLAp9Owp9KShzZWxmKTsK", 443 | "ok": true, 444 | "headers": [ 445 | [ 446 | "content-type", 447 | "application/javascript" 448 | ] 449 | ], 450 | "status": 200, 451 | "status_text": "" 452 | } 453 | }, 454 | "base_uri": "https://localhost:8080/", 455 | "height": 72 456 | }, 457 | "outputId": "0225f8ca-01b9-4a99-8937-3e476488a370" 458 | }, 459 | "source": [ 460 | "from google.colab import files\n", 461 | "\n", 462 | "uploaded = files.upload()" 463 | ], 464 | "execution_count": 24, 465 | "outputs": [ 466 | { 467 | "output_type": "display_data", 468 | "data": { 469 | "text/html": [ 470 | "\n", 471 | " \n", 473 | " \n", 474 | " Upload widget is only available when the cell has been executed in the\n", 475 | " current browser session. Please rerun this cell to enable.\n", 476 | " \n", 477 | " " 478 | ], 479 | "text/plain": [ 480 | "" 481 | ] 482 | }, 483 | "metadata": { 484 | "tags": [] 485 | } 486 | }, 487 | { 488 | "output_type": "stream", 489 | "text": [ 490 | "Saving vdo2.mp4 to vdo2.mp4\n" 491 | ], 492 | "name": "stdout" 493 | } 494 | ] 495 | }, 496 | { 497 | "cell_type": "code", 498 | "metadata": { 499 | "id": "HrsJs6-ZqbZx", 500 | "colab_type": "code", 501 | "colab": { 502 | "base_uri": "https://localhost:8080/", 503 | "height": 86 504 | }, 505 | "outputId": "e8ab9d5a-6bcf-49b5-c163-d351ff763bb5" 506 | }, 507 | "source": [ 508 | "!pip install fastscript" 509 | ], 510 | "execution_count": 6, 511 | "outputs": [ 512 | { 513 | "output_type": "stream", 514 | "text": [ 515 | "Collecting fastscript\n", 516 | " Downloading https://files.pythonhosted.org/packages/55/0e/ecdc0213646bc82986884121109a38b50bbc2cd2c491bbbfdc7ae39228e3/fastscript-0.1.4-py3-none-any.whl\n", 517 | "Installing collected packages: fastscript\n", 518 | "Successfully installed fastscript-0.1.4\n" 519 | ], 520 | "name": "stdout" 521 | } 522 | ] 523 | }, 524 | { 525 | "cell_type": "code", 526 | "metadata": { 527 | "id": "1WykjFaPq6Dj", 528 | "colab_type": "code", 529 | "colab": { 530 | "base_uri": "https://localhost:8080/", 531 | "height": 242 532 | }, 533 | "outputId": "3fbee4b2-3a5a-4d3e-c2ef-037589c9c096" 534 | }, 535 | "source": [ 536 | "!pip install -U PyYAML" 537 | ], 538 | "execution_count": 7, 539 | "outputs": [ 540 | { 541 | "output_type": "stream", 542 | "text": [ 543 | "Collecting PyYAML\n", 544 | "\u001b[?25l Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)\n", 545 | "\r\u001b[K |█▏ | 10kB 21.9MB/s eta 0:00:01\r\u001b[K |██▍ | 20kB 5.2MB/s eta 0:00:01\r\u001b[K |███▋ | 30kB 5.4MB/s eta 0:00:01\r\u001b[K |████▉ | 40kB 6.3MB/s eta 0:00:01\r\u001b[K |██████ | 51kB 6.2MB/s eta 0:00:01\r\u001b[K |███████▎ | 61kB 7.2MB/s eta 0:00:01\r\u001b[K |████████▌ | 71kB 7.0MB/s eta 0:00:01\r\u001b[K |█████████▊ | 81kB 6.8MB/s eta 0:00:01\r\u001b[K |███████████ | 92kB 6.9MB/s eta 0:00:01\r\u001b[K |████████████▏ | 102kB 7.1MB/s eta 0:00:01\r\u001b[K |█████████████▍ | 112kB 7.1MB/s eta 0:00:01\r\u001b[K |██████████████▋ | 122kB 7.1MB/s eta 0:00:01\r\u001b[K |███████████████▉ | 133kB 7.1MB/s eta 0:00:01\r\u001b[K |█████████████████ | 143kB 7.1MB/s eta 0:00:01\r\u001b[K |██████████████████▎ | 153kB 7.1MB/s eta 0:00:01\r\u001b[K |███████████████████▌ | 163kB 7.1MB/s eta 0:00:01\r\u001b[K |████████████████████▊ | 174kB 7.1MB/s eta 0:00:01\r\u001b[K |██████████████████████ | 184kB 7.1MB/s eta 0:00:01\r\u001b[K |███████████████████████▏ | 194kB 7.1MB/s eta 0:00:01\r\u001b[K |████████████████████████▎ | 204kB 7.1MB/s eta 0:00:01\r\u001b[K |█████████████████████████▌ | 215kB 7.1MB/s eta 0:00:01\r\u001b[K |██████████████████████████▊ | 225kB 7.1MB/s eta 0:00:01\r\u001b[K |████████████████████████████ | 235kB 7.1MB/s eta 0:00:01\r\u001b[K |█████████████████████████████▏ | 245kB 7.1MB/s eta 0:00:01\r\u001b[K |██████████████████████████████▍ | 256kB 7.1MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▋| 266kB 7.1MB/s eta 0:00:01\r\u001b[K |████████████████████████████████| 276kB 7.1MB/s \n", 546 | "\u001b[?25hBuilding wheels for collected packages: PyYAML\n", 547 | " Building wheel for PyYAML (setup.py) ... \u001b[?25l\u001b[?25hdone\n", 548 | " Created wheel for PyYAML: filename=PyYAML-5.3.1-cp36-cp36m-linux_x86_64.whl size=44621 sha256=7b1f32bfe6137fe85cc02d0655b9622a0843dfd8afbaa6221ea2a935838b4700\n", 549 | " Stored in directory: /root/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd\n", 550 | "Successfully built PyYAML\n", 551 | "Installing collected packages: PyYAML\n", 552 | " Found existing installation: PyYAML 3.13\n", 553 | " Uninstalling PyYAML-3.13:\n", 554 | " Successfully uninstalled PyYAML-3.13\n", 555 | "Successfully installed PyYAML-5.3.1\n" 556 | ], 557 | "name": "stdout" 558 | } 559 | ] 560 | }, 561 | { 562 | "cell_type": "code", 563 | "metadata": { 564 | "id": "XxaiANEdcAMT", 565 | "colab_type": "code", 566 | "colab": { 567 | "base_uri": "https://localhost:8080/", 568 | "height": 52 569 | }, 570 | "outputId": "3aea4fa2-1014-47a9-8ef7-df3cd78d3411" 571 | }, 572 | "source": [ 573 | "!ls" 574 | ], 575 | "execution_count": 13, 576 | "outputs": [ 577 | { 578 | "output_type": "stream", 579 | "text": [ 580 | "00.mp4\tconf.yml\t sample_data web2.png\n", 581 | "00.png\tgenerated_video.mp4 vox-cpk.pth.tar Webp.jpg\n" 582 | ], 583 | "name": "stdout" 584 | } 585 | ] 586 | }, 587 | { 588 | "cell_type": "code", 589 | "metadata": { 590 | "id": "iVlVq0DpqEYd", 591 | "colab_type": "code", 592 | "colab": { 593 | "base_uri": "https://localhost:8080/", 594 | "height": 34 595 | }, 596 | "outputId": "a764f4a0-116a-4a63-cf36-1e80a54af8da" 597 | }, 598 | "source": [ 599 | "!deep_animate r2.jpg vdo2.mp4 conf.yml vox-cpk.pth.tar" 600 | ], 601 | "execution_count": 27, 602 | "outputs": [ 603 | { 604 | "output_type": "stream", 605 | "text": [ 606 | "100% 327/327 [00:12<00:00, 25.24it/s]\n" 607 | ], 608 | "name": "stdout" 609 | } 610 | ] 611 | }, 612 | { 613 | "cell_type": "code", 614 | "metadata": { 615 | "id": "pcG8i2WNq9cU", 616 | "colab_type": "code", 617 | "colab": { 618 | "base_uri": "https://localhost:8080/", 619 | "height": 52 620 | }, 621 | "outputId": "ead97376-50ff-4ebf-b459-a89226d97e0b" 622 | }, 623 | "source": [ 624 | "!ls" 625 | ], 626 | "execution_count": 26, 627 | "outputs": [ 628 | { 629 | "output_type": "stream", 630 | "text": [ 631 | "00.mp4\tconf.yml\t r2.jpg\t t21.jpg vdo2.mp4\t web2.png\n", 632 | "00.png\tgenerated_video.mp4 sample_data vd01.mp4 vox-cpk.pth.tar Webp.jpg\n" 633 | ], 634 | "name": "stdout" 635 | } 636 | ] 637 | }, 638 | { 639 | "cell_type": "code", 640 | "metadata": { 641 | "id": "y6_yf9uLq-7j", 642 | "colab_type": "code", 643 | "colab": {} 644 | }, 645 | "source": [ 646 | "# select the folder left of you and downlooad generated_video.mp4" 647 | ], 648 | "execution_count": null, 649 | "outputs": [] 650 | }, 651 | { 652 | "cell_type": "code", 653 | "metadata": { 654 | "id": "fWYMpVCaq_NK", 655 | "colab_type": "code", 656 | "colab": {} 657 | }, 658 | "source": [ 659 | "" 660 | ], 661 | "execution_count": null, 662 | "outputs": [] 663 | }, 664 | { 665 | "cell_type": "code", 666 | "metadata": { 667 | "id": "A1DXtl-jqfnK", 668 | "colab_type": "code", 669 | "colab": {} 670 | }, 671 | "source": [ 672 | "" 673 | ], 674 | "execution_count": null, 675 | "outputs": [] 676 | } 677 | ] 678 | } --------------------------------------------------------------------------------