├── README.md ├── _internal └── DeepFaceLab │ └── requirements-cuda.txt ├── install_CentOS.md ├── install_script ├── 1_CentOS_install_dependencies.sh └── 1_Ubuntu_install_dependencies.sh └── scripts ├── 1_clear_workspace.sh ├── 2_extract_images_from_video_data_src.sh ├── 3_cut_video_drop_video_on_me.sh ├── 3_extract_images_from_video_data_dst_FULL_FPS.sh ├── 3_optional_denoise_data_dst_images.sh ├── 4.0_data_src_faceset_extract.sh ├── 4.0_data_src_faceset_extract_MANUAL.sh ├── 4.2_data_src_sort.sh ├── 4.2_data_src_util_add_landmarks_debug_images.sh ├── 4.2_data_src_util_faceset_enhance.sh ├── 4.2_data_src_util_faceset_metadata_restore.sh ├── 4.2_data_src_util_faceset_metadata_save.sh ├── 4.2_data_src_util_faceset_pack.sh ├── 4.2_data_src_util_faceset_unpack.sh ├── 4.2_data_src_util_recover_original_filename.sh ├── 5.0_data_dst_faceset_MANUAL_RE-EXTRACT_DELETED_ALIGNED_DEBUG.sh ├── 5.0_data_dst_faceset_extract.sh ├── 5.0_data_dst_faceset_extract_+_manual_fix.sh ├── 5.0_data_dst_faceset_extract_MANUAL.sh ├── 5.2_data_dst_sort.sh ├── 5.2_data_dst_util_faceset_pack.sh ├── 5.2_data_dst_util_faceset_unpack.sh ├── 5.2_data_dst_util_recover_original_filename.sh ├── 5.XSeg_data_dst_mask_for_XSeg_trainer_-_edit.sh ├── 5.XSeg_data_dst_mask_for_XSeg_trainer_-_fetch.sh ├── 5.XSeg_data_dst_mask_for_XSeg_trainer_-_remove.sh ├── 5.XSeg_data_src_mask_for_XSeg_trainer_-_edit.sh ├── 5.XSeg_data_src_mask_for_XSeg_trainer_-_fetch.sh ├── 5.XSeg_data_src_mask_for_XSeg_trainer_-_remove.sh ├── 5.XSeg_optional_trained_mask_for_data_dst_-_apply.sh ├── 5.XSeg_optional_trained_mask_for_data_dst_-_remove.sh ├── 5.XSeg_optional_trained_mask_for_data_src_-_apply.sh ├── 5.XSeg_optional_trained_mask_for_data_src_-_remove.sh ├── 5.XSeg_train.sh ├── 6_train_Quick96.sh ├── 6_train_SAEHD.sh ├── 7_merge_Quick96.sh ├── 7_merge_SAEHD.sh ├── 8_merged_to_avi.sh ├── 8_merged_to_mov_lossless.sh ├── 8_merged_to_mp4.sh ├── 8_merged_to_mp4_lossless.sh └── env.sh /README.md: -------------------------------------------------------------------------------- 1 | # DeepFaceLab Guide for Linux Users 2 | **Prerequisite:** You need CUDA enabled GPU. 3 | 4 | **Note:** This method installs DFL on Centos 7/8 or Ubuntu 18.04 and provides an option to use Anaconda 5 |     To install CentOS, refer [here](install_CentOS.md) 6 |     To install Ubuntu, [coming soon] 7 | 8 | The directory structure is important. 9 | This is how the project tree will look like: 10 | ```bash 11 | DeepFaceLab_NVIDIA_Linux 12 | |-- _internal 13 | | |-- DeepFaceLab # Created via git clone command (Step #2) 14 | | |-- pretrain_CelebA # Manually copied after extracting .EXE (Step #3) 15 | | `-- pretrain_Quick96 # Manually copied after extracting .EXE (Step #3) 16 | |-- install_script # Created via git clone command (Step #0) 17 | |-- scripts # Created via git clone command (Step #0) 18 | `-- workspace # Created through one of the scripts in /scripts 19 | ``` 20 | 21 | ## Step #0: Preparation 22 | Clone this repository 23 | ```sh 24 | git clone https://github.com/jwchoi09/DeepFaceLab_NVIDIA_Linux.git 25 | cd DeepFaceLab_NVIDIA_Linux 26 | ``` 27 | 28 | Install NVIDIA driver and Dependencies 29 | Navigate to `DeepFaceLab_NVIDIA_Linux/install_script` directory and run: 30 |
    31 |
  1. CentOS:
    bash 1_CentOS_install_dependencies.sh
    32 |
  2. Ubuntu:
    bash 1_Ubuntu_install_dependencies.sh
    33 |
34 | 35 | ## Step #1: Setup Environment 36 |
    37 |
  1. on Anaconda: (recommended) 38 | Install Anaconda 39 | 40 | URL #4: https://www.anaconda.com/distribution/#linux 41 | URL #5: https://docs.anaconda.com/anaconda/install/linux/ 42 | 43 | **Note:** Download Python 3.7 version (at the time of writing: 05/22/2020) 44 | Through the terminal, locate to Anaconda download destination and run the following: 45 | ```sh 46 | bash Anaconda3-2020.02-Linux-x86_64.sh 47 | ``` 48 | 49 | The installer prompts "In order to continue the installation process, please review the license agreement." 50 | Click Enter to view license terms. 51 | Scroll to the bottom of the license terms and enter "Yes" to agree. 52 | Accept the default install location. 53 | Type "yes" to the prompt, "Do you wish the installer to initialize Anaconda3 by running conda init?" 54 | Close and open your terminal window for the installation to take effect, or you can enter the command: 55 | ```sh 56 | source ~/.bashrc 57 | ``` 58 | Create the DeepFaceLab environment with the following libraries in the terminal: 59 | ```bash 60 | conda create -n deepfacelab -c main python=3.6.8 cudnn=7.6.5 cudatoolkit=10.0.130 61 | ``` 62 | 63 | Activate the environment 64 | ```bash 65 | conda activate deepfacelab 66 | ``` 67 |
    68 | 69 |
  2. on system: 70 | Install python 3.6.8, cudnn 7.6.5, cudatoolkit 10.0.130 71 |
      72 |
    1. CentOS: 73 | 74 |
      75 |
    2. Ubuntu: 76 | 77 |
      78 |
    79 |
80 | 81 | Install Python Dependencies 82 | ```sh 83 | python3 -m pip install -r ./DeepFaceLab/requirements-cuda.txt 84 | ``` 85 | 86 | ## Step #2: Install [or Update] DeepFaceLab 87 | 88 | This step involves deleting the already existing DeepFaceLab directory from the `_internal` directory, and 89 | cloning DeepFaceLab from the main repository to the `_internal` directory 90 | ```sh 91 | sudo rm -rf DeepFaceLab 92 | git clone https://github.com/iperov/DeepFaceLab.git 93 | ``` 94 | 95 | ## Step #3: Download CelebA Dataset and Quick96 Model 96 | 97 | Download the latest NVIDIA build(.EXE) from the main repo for Windows 98 | To download, refer to the Google Drive link provided in here: https://github.com/iperov/DeepFaceLab/ 99 | Extract the build. 100 | ```sh 101 | 7z x DeepFaceLab_NVIDIA_build_XX_XX_XXX.exe 102 | ``` 103 | 104 | Once the build has been extracted, there will be `_internal` directory. 105 | From it, copy both `pretrain_CelebA` and `pretrain_Quick96` to the directory `DeepFaceLab_NVIDIA_Linux/_internal/` 106 | 107 | 108 | ## Step #4: Navigate to the scripts directory and begin using DeepFaceLab 109 | (Further guide coming soon!) 110 | -------------------------------------------------------------------------------- /_internal/DeepFaceLab/requirements-cuda.txt: -------------------------------------------------------------------------------- 1 | tqdm 2 | numpy 3 | h5py 4 | opencv-python 5 | ffmpeg-python 6 | scikit-image 7 | scipy 8 | colorama 9 | labelme=4.2.9 10 | tensorflow-gpu==1.13.2 11 | -------------------------------------------------------------------------------- /install_CentOS.md: -------------------------------------------------------------------------------- 1 | 2 | # Install CentOS 7/8 3 | URL #1: https://linoxide.com/distros/how-to-install-centos/ 4 | 5 | ## Step 1: Download CentOS 8 6 | URL #2: https://www.centos.org/download/ 7 | 8 | ## Step 2: Make a bootable device 9 | Format the USB device 10 | 11 | ### a. On Windows 12 | URL #3: https://wiki.centos.org/HowTos/InstallFromUSBkey 13 | As stated above, applications "unetbootin, multibootusb and universal usb installler" does not work; 14 | instead, use "Rufus[does not work correctly if the wrong options are chosen], Fedora LiveUSB Creator, Win32 Disk Imager, Rawrite32, dd for Windows" 15 | 16 | ### b. On MacOS 17 | URL #4: https://docs.centos.org/en-US/8-docs/standard-install/assembly_preparing-for-your-installation/ 18 | in the terminal, type: 19 |
20 | sudo dd if=/path/to/image.iso of=/dev/rdisk# bs=4m
21 | 
22 | replace "/path/to/image.iso" with the actual directory, and # with the actual drive number 23 | 24 | ### c. On Linux 25 | in the terminal, type: 26 |
27 | sudo dd if=/path/to/image.iso of=/dev/device bs=4m
28 | 
29 | similar to MacOS, 30 | replace "/path/to/image.iso" with the full path to the ISO image file, and replace "device" with the device name 31 | 32 | 33 | ## Step 3: Start with the installation process 34 | Insert the USB device and then boot 35 | Choose and hit enter: 36 | ```sh 37 | Install CentOS Linux x.x.xxxx 38 | ``` 39 | 40 | ## Step 4: Choose the language for the installation 41 | English, English (United States) 42 | 43 | ## Step 5: Summary Page 44 | Keyboard: English(US) 45 | Language Support: English (United States) 46 | Time & Date: your preference 47 | Installation Source: Local Media 48 | Software Selection: Server with GUI, Container Management, Developer Tools, Graphical Admin Tools 49 | Installation Destination: where you want it to be installed (becareful, it will wipe data) (Automatic Partitioning) 50 | KDUMP: backup system, I disabled it in my case. 51 | 52 | ## Step 6: Configure the network and hostname 53 | Make sure you are connected to the internet so that we will be able to install some features later during the process 54 | 55 | ## Step 7: Begin the installation 56 | 57 | ## Step 8: Create your user account 58 | Full name is optional 59 | Tick "Make this user administrator" 60 | Tick "Require a password to use this account" 61 | 62 | ## Step 9: Configure the root password 63 | 64 | ## Step 10: Reboot and accept the license agreement 65 | 66 | ## Step 11: Log in your new system 67 | Confirm 68 | Done! 69 | -------------------------------------------------------------------------------- /install_script/1_CentOS_install_dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install epel-release 4 | sudo dnf -y install epel-release 5 | sudo dnf config-manager --set-enabled PowerTools 6 | 7 | # Confirm EPEL installation 8 | sudo dnf repolist epel 9 | 10 | # Update System 11 | sudo dnf check-update 12 | sudo dnf -y update 13 | 14 | # Install prerequisites for Anaconda3 15 | sudo dnf -y install libXcomposite libXcursor libXi libXtst libXrandr alsa-lib mesa-libEGL libXdamage mesa-libGL libXScrnSaver 16 | 17 | # Install DeepFaceLab Dependencies 18 | sudo dnf -y install ffmpeg ffmpeg-devel gcc gcc-c++ kernel-devel git 19 | # sudo dnf -y groupinstall "Development Tools" 20 | 21 | # Install the latest NVIDIA Driver (Long Lived Branch) 22 | -------------------------------------------------------------------------------- /install_script/1_Ubuntu_install_dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Update System 4 | sudo apt update 5 | sudo apt -y dist-upgrade 6 | 7 | # Install prerequisites for Anaconda3 8 | sudo apt -y install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 9 | 10 | # Install DeepFaceLab Dependencies 11 | sudo apt -y install ffmpeg cmake build-essential git 12 | 13 | # Install the latest NVIDIA Driver (Long Lived Branch) 14 | -------------------------------------------------------------------------------- /scripts/1_clear_workspace.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | rm -rf "$DFL_WORKSPACE" 5 | mkdir -p "$DFL_WORKSPACE" 6 | mkdir -p "$DFL_WORKSPACE/data_src/aligned" 7 | mkdir -p "$DFL_WORKSPACE/data_dst/aligned" 8 | mkdir -p "$DFL_WORKSPACE/model" 9 | 10 | -------------------------------------------------------------------------------- /scripts/2_extract_images_from_video_data_src.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed extract-video \ 5 | --input-file "$DFL_WORKSPACE/data_src.*" \ 6 | --output-dir "$DFL_WORKSPACE/data_src" 7 | 8 | -------------------------------------------------------------------------------- /scripts/3_cut_video_drop_video_on_me.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed cut-video \ 5 | --input-file $1 6 | 7 | -------------------------------------------------------------------------------- /scripts/3_extract_images_from_video_data_dst_FULL_FPS.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed extract-video \ 5 | --input-file "$DFL_WORKSPACE/data_dst.*" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst" \ 7 | --fps 0 8 | 9 | -------------------------------------------------------------------------------- /scripts/3_optional_denoise_data_dst_images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed denoise-image-sequence \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" 6 | 7 | -------------------------------------------------------------------------------- /scripts/4.0_data_src_faceset_extract.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" extract \ 5 | --input-dir "$DFL_WORKSPACE/data_src" \ 6 | --output-dir "$DFL_WORKSPACE/data_src/aligned" \ 7 | --detector s3fd 8 | 9 | -------------------------------------------------------------------------------- /scripts/4.0_data_src_faceset_extract_MANUAL.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" extract \ 5 | --input-dir "$DFL_WORKSPACE/data_src" \ 6 | --output-dir "$DFL_WORKSPACE/data_src/aligned" \ 7 | --detector manual 8 | 9 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_sort.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" sort \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_add_landmarks_debug_images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --add-landmarks-debug-images 7 | 8 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_faceset_enhance.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" facesettool enhance \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_faceset_metadata_restore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --restore-faceset-metadata 7 | 8 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_faceset_metadata_save.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --save-faceset-metadata 7 | 8 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_faceset_pack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --pack-faceset 7 | 8 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_faceset_unpack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --unpack-faceset 7 | 8 | -------------------------------------------------------------------------------- /scripts/4.2_data_src_util_recover_original_filename.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --recover-original-aligned-filename 7 | 8 | -------------------------------------------------------------------------------- /scripts/5.0_data_dst_faceset_MANUAL_RE-EXTRACT_DELETED_ALIGNED_DEBUG.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" extract \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --detector manual \ 8 | --output-debug \ 9 | --manual-output-debug-fix 10 | 11 | -------------------------------------------------------------------------------- /scripts/5.0_data_dst_faceset_extract.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" extract \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --detector s3fd \ 8 | --output-debug 9 | 10 | -------------------------------------------------------------------------------- /scripts/5.0_data_dst_faceset_extract_+_manual_fix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" extract \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --detector s3fd \ 8 | --output-debug \ 9 | --manual-fix 10 | 11 | -------------------------------------------------------------------------------- /scripts/5.0_data_dst_faceset_extract_MANUAL.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" extract \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --detector manual \ 8 | --output-debug 9 | 10 | -------------------------------------------------------------------------------- /scripts/5.2_data_dst_sort.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" sort \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/5.2_data_dst_util_faceset_pack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" \ 6 | --pack-faceset 7 | 8 | -------------------------------------------------------------------------------- /scripts/5.2_data_dst_util_faceset_unpack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" \ 6 | --unpack-faceset 7 | 8 | -------------------------------------------------------------------------------- /scripts/5.2_data_dst_util_recover_original_filename.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" util \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" \ 6 | --recover-original-aligned-filename 7 | 8 | -------------------------------------------------------------------------------- /scripts/5.XSeg_data_dst_mask_for_XSeg_trainer_-_edit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg editor \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" 6 | 7 | if [ $? -ne 0]; then 8 | read -n1 9 | fi 10 | -------------------------------------------------------------------------------- /scripts/5.XSeg_data_dst_mask_for_XSeg_trainer_-_fetch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg fetch \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/5.XSeg_data_dst_mask_for_XSeg_trainer_-_remove.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg remove_labels \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/5.XSeg_data_src_mask_for_XSeg_trainer_-_edit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg editor \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" 6 | 7 | if [ $? -ne 0]; then 8 | read -n1 9 | fi 10 | 11 | -------------------------------------------------------------------------------- /scripts/5.XSeg_data_src_mask_for_XSeg_trainer_-_fetch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg fetch \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/5.XSeg_data_src_mask_for_XSeg_trainer_-_remove.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg remove_labels \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/5.XSeg_optional_trained_mask_for_data_dst_-_apply.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg apply \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" \ 6 | --model-dir "$DFL_WORKSPACE/model" 7 | 8 | -------------------------------------------------------------------------------- /scripts/5.XSeg_optional_trained_mask_for_data_dst_-_remove.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg remove \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/aligned" 6 | 7 | -------------------------------------------------------------------------------- /scripts/5.XSeg_optional_trained_mask_for_data_src_-_apply.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg apply \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --model-dir "$DFL_WORKSPACE/model" 7 | 8 | -------------------------------------------------------------------------------- /scripts/5.XSeg_optional_trained_mask_for_data_src_-_remove.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" xseg remove \ 5 | --input-dir "$DFL_WORKSPACE/data_src/aligned" 6 | -------------------------------------------------------------------------------- /scripts/5.XSeg_train.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" train \ 5 | --training-data-src-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --training-data-dst-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --model-dir "$DFL_WORKSPACE/model" \ 8 | --model XSeg 9 | 10 | -------------------------------------------------------------------------------- /scripts/6_train_Quick96.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" train \ 5 | --training-data-src-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --training-data-dst-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --pretraining-data-dir "$INTERNAL/pretrain_CelebA" \ 8 | --pretrained-model-dir "$INTERNAL/pretrain_Quick96" \ 9 | --model-dir "$DFL_WORKSPACE/model" \ 10 | --model Quick96 11 | 12 | -------------------------------------------------------------------------------- /scripts/6_train_SAEHD.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" train \ 5 | --training-data-src-dir "$DFL_WORKSPACE/data_src/aligned" \ 6 | --training-data-dst-dir "$DFL_WORKSPACE/data_dst/aligned" \ 7 | --pretraining-data-dir "$INTERNAL/pretrain_CelebA" \ 8 | --model-dir "$DFL_WORKSPACE/model" \ 9 | --model SAEHD 10 | 11 | -------------------------------------------------------------------------------- /scripts/7_merge_Quick96.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" merge \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst/merged" \ 7 | --output-mask-dir "$DFL_WORKSPACE/data_dst/merged_mask" \ 8 | --aligned-dir "$DFL_WORKSPACE/data_dst/aligned" \ 9 | --model-dir "$DFL_WORKSPACE/model" \ 10 | --model Quick96 11 | 12 | -------------------------------------------------------------------------------- /scripts/7_merge_SAEHD.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" merge \ 5 | --input-dir "$DFL_WORKSPACE/data_dst" \ 6 | --output-dir "$DFL_WORKSPACE/data_dst/merged" \ 7 | --output-mask-dir "$DFL_WORKSPACE/data_dst/merged_mask" \ 8 | --aligned-dir "$DFL_WORKSPACE/data_dst/aligned" \ 9 | --model-dir "$DFL_WORKSPACE/model" \ 10 | --model SAEHD 11 | 12 | -------------------------------------------------------------------------------- /scripts/8_merged_to_avi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/merged" \ 6 | --output-file "$DFL_WORKSPACE/result.avi" \ 7 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 8 | --include-audio 9 | 10 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 11 | --input-dir "$DFL_WORKSPACE/data_dst/merged_mask" \ 12 | --output-file "$DFL_WORKSPACE/result_mask.avi" \ 13 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 14 | --lossless 15 | 16 | -------------------------------------------------------------------------------- /scripts/8_merged_to_mov_lossless.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/merged" \ 6 | --output-file "$DFL_WORKSPACE/result.mov" \ 7 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 8 | --include-audio \ 9 | --lossless 10 | 11 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 12 | --input-dir "$DFL_WORKSPACE/data_dst/merged_mask" \ 13 | --output-file "$DFL_WORKSPACE/result_mask.mov" \ 14 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 15 | --lossless 16 | 17 | -------------------------------------------------------------------------------- /scripts/8_merged_to_mp4.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/merged" \ 6 | --output-file "$DFL_WORKSPACE/result.mp4" \ 7 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 8 | --include-audio 9 | 10 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 11 | --input-dir "$DFL_WORKSPACE/data_dst/merged_mask" \ 12 | --output-file "$DFL_WORKSPACE/result_mask.mp4" \ 13 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 14 | --lossless 15 | 16 | -------------------------------------------------------------------------------- /scripts/8_merged_to_mp4_lossless.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | source env.sh 3 | 4 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 5 | --input-dir "$DFL_WORKSPACE/data_dst/merged" \ 6 | --output-file "$DFL_WORKSPACE/result.mp4" \ 7 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 8 | --include-audio \ 9 | --lossless 10 | 11 | $DFL_PYTHON "$DFL_ROOT/main.py" videoed video-from-sequence \ 12 | --input-dir "$DFL_WORKSPACE/data_dst/merged_mask" \ 13 | --output-file "$DFL_WORKSPACE/result_mask.mp4" \ 14 | --reference-file "$DFL_WORKSPACE/data_dst.*" \ 15 | --lossless 16 | 17 | -------------------------------------------------------------------------------- /scripts/env.sh: -------------------------------------------------------------------------------- 1 | source ~/anaconda3/etc/profile.d/conda.sh 2> /dev/null 2 | conda activate deepfacelab 2> /dev/null 3 | 4 | # ========== BASE ENV ========== 5 | export INTERNAL=$(cd .. && cd _internal && pwd) 6 | 7 | 8 | # ========== PYTHON ENV ========== 9 | export DFL_PYTHON="python3.6" 10 | 11 | # ========== CUDA ENV ========== 12 | 13 | # ========== ADDITIONAL ENV ========== 14 | export DFL_WORKSPACE="$INTERNAL/../workspace/" 15 | export DFL_ROOT="$INTERNAL/DeepFaceLab" 16 | export TF_MIN_REQ_CAP=30 17 | 18 | 19 | if [ ! -d "$DFL_WORKSPACE" ]; then 20 | mkdir -p "$DFL_WORKSPACE" 21 | mkdir -p "$DFL_WORKSPACE/data_src/aligned" 22 | mkdir -p "$DFL_WORKSPACE/data_dst/aligned" 23 | mkdir -p "$DFL_WORKSPACE/model" 24 | fi 25 | --------------------------------------------------------------------------------