From 7de67fcbebacf88aa34fd3eec464ec4f91005bac Mon Sep 17 00:00:00 2001
From: anothermartz <89461919+anothermartz@users.noreply.github.com>
Date: Fri, 15 Mar 2024 22:18:40 +0000
Subject: [PATCH] Fixed step 1 falsely completing
---
Easy_Wav2Lip_v8.1_quickfix.ipynb | 289 +++++++++++++++++++++++++++++++
1 file changed, 289 insertions(+)
create mode 100644 Easy_Wav2Lip_v8.1_quickfix.ipynb
diff --git a/Easy_Wav2Lip_v8.1_quickfix.ipynb b/Easy_Wav2Lip_v8.1_quickfix.ipynb
new file mode 100644
index 0000000..b27035a
--- /dev/null
+++ b/Easy_Wav2Lip_v8.1_quickfix.ipynb
@@ -0,0 +1,289 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "fkoF-mm8CGfB"
+ },
+ "source": [
+ "Welcome to my Easy Wav2Lip colab!\n",
+ "\n",
+ "My goal is to make lipsyncing with this tool easy, fast and great looking!\n",
+ "\n",
+ "Please view the GitHub for instructions: https://github.com/anothermartz/Easy-Wav2Lip/tree/v8#best-practices"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "OZJJ-zPGiiIs",
+ "cellView": "form"
+ },
+ "outputs": [],
+ "source": [
+ "version = 'v8.1'\n",
+ "#@title
Step 1: Setup \"Easy-Wav2Lip\"
With one button: it's really that easy!\n",
+ "#@markdown 👈 Click that little circle play button first - it will ask for Google Drive access: \n",
+ "#@markdown > Accept if your files are on Google Drive (recommended).\n",
+ "#@markdown Alternatively, you can click deny and upload files manually, but this is slower.\n",
+ "\n",
+ "#check if already installed\n",
+ "import os\n",
+ "import sys\n",
+ "if os.path.exists('installed.txt'):\n",
+ " with open('last_file.txt', 'r') as file:\n",
+ " last_file = file.readline()\n",
+ " if last_file == version:\n",
+ " sys.exit('Easy-Wav2Lip '+version+' has already been run on this instance!')\n",
+ "\n",
+ "\n",
+ "#check GPU is enabled\n",
+ "print('checking for GPU')\n",
+ "import torch\n",
+ "if not torch.cuda.is_available():\n",
+ " sys.exit('No GPU in runtime. Please go to the \"Runtime\" menu, \"Change runtime type\" and select \"GPU\".')\n",
+ "\n",
+ "#prompt to mount google drive\n",
+ "print('requesting Google Drive access')\n",
+ "try:\n",
+ " from google.colab import drive\n",
+ " drive.mount('/content/drive')\n",
+ "except:\n",
+ " print(\"google drive not linked\")\n",
+ "\n",
+ "\n",
+ "#start timer\n",
+ "import time\n",
+ "start_time = time.time()\n",
+ "\n",
+ "#clone git\n",
+ "giturl = 'https://github.com/anothermartz/Easy-Wav2Lip.git'\n",
+ "\n",
+ "\n",
+ "!git clone -b {version} {giturl}\n",
+ "%cd 'Easy-Wav2Lip'\n",
+ "working_directory = os.getcwd()\n",
+ "!mkdir 'face_alignment' 'temp'\n",
+ "\n",
+ "#install prerequisites\n",
+ "!pip install -r requirements.txt\n",
+ "print('installing batch_face')\n",
+ "import warnings\n",
+ "warnings.filterwarnings(\"ignore\", category=UserWarning,\n",
+ " module='torchvision.transforms.functional_tensor')\n",
+ "!pip install batch_face --quiet\n",
+ "print('installing gfpgan')\n",
+ "!pip install gfpgan --quiet\n",
+ "\n",
+ "!python install.py\n",
+ "\n",
+ "from IPython.display import clear_output\n",
+ "clear_output()\n",
+ "print(\"Installation complete, move to Step 2!\")\n",
+ "\n",
+ "#end timer\n",
+ "elapsed_time = time.time() - start_time\n",
+ "from easy_functions import format_time\n",
+ "print(f\"Execution time: {format_time(elapsed_time)}\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "if not os.path.exists('installed.txt'):\n",
+ " sys.exit('Step 1 has not been run in this instance! Please run step 1 each time you disconnect from a runtime.')\n",
+ "time\n",
+ "############################## user inputs #####################################\n",
+ "#@markdown
Step 2: Select inputs:
\n",
+ "\n",
+ "# @markdown On destktop: Click the folder icon ( 📁 ) at the left edge of colab, find your file, right click, copy path, paste it below:\n",
+ "#@markdown \n",
+ "# @markdown On mobile: Tap the hamburger button ( ☰ ) at the top left, click show file browser, find your file, long press on it, copy path, paste below:\n",
+ "video_file = \"\" #@param {type:\"string\"}\n",
+ "vocal_file = \"\" #@param {type:\"string\"}\n",
+ "\n",
+ "#@markdown > Keep vocal_file blank if your video already has the desired speech audio encoded into it.\n",
+ "#@markdown # Quality\n",
+ "quality = \"Improved\" # @param [\"Fast\", \"Improved\", \"Enhanced\", \"Experimental\"]\n",
+ "#@markdown * Fast: Wav2Lip \n",
+ "#@markdown * Improved: Wav2Lip with a feathered mask around the mouth to remove the square around the face \n",
+ "#@markdown * Enhanced: Wav2Lip + mask + GFPGAN upscaling done on the face\n",
+ "#@markdown * Experimental: Test version of applying gfpgan - see [release notes](https://github.com/anothermartz/Easy-Wav2Lip/releases/tag/v7_release)\n",
+ "#preview_quality = False #@param {type:\"boolean\"} - coming soon!\n",
+ "output_height = \"full resolution\" #@param [\"half resolution\", \"full resolution\", \"480\"] {allow-input: true}\n",
+ "use_previous_tracking_data = True #@param {type:\"boolean\"}\n",
+ "#@markdown Speeds up processing of the same video used multiple times - it should delete the last tracking file automatically when the video is changed but if it's failing after the first video, untick this box.\n",
+ "\n",
+ "#@markdown\n",
+ "#------------------------------*Step 3*----------------------------------------!\n",
+ "#@markdown
👈 Step 3: Click the little circle play button on this cell!