MrDeepFakes Forums

Some content may not be available to Guests. Consider registering an account to enjoy unrestricted access to guides, support and tools

  • We are looking for community members who are intested in helping out. See our HELP WANTED post.

Customize DeepFaceLab 2.0

Status
Not open for further replies.
It seems that there is no batch file for people with one CPU with built-in CPU and one graphic board in the system.

The following files can be created.

4) data_src extract faces S3FD best GPU.bat
5) data_dst extract faces S3FD best GPU.bat


4) data_src extract faces S3FD best GPU.bat

@echo off
call _internal\setenv.bat

"%PYTHON_EXECUTABLE%" "%DFL_ROOT%\main.py" extract ^
    --input-dir "%WORKSPACE%\data_src" ^
    --output-dir "%WORKSPACE%\data_src\aligned" ^
    --detector s3fd ^
    --output-debug ^
    --force-gpu-idxs 0

pause



5) data_dst extract faces S3FD best GPU.bat

@echo off
call _internal\setenv.bat

"%PYTHON_EXECUTABLE%" "%DFL_ROOT%\main.py" extract ^
    --input-dir "%WORKSPACE%\data_dst" ^
    --output-dir "%WORKSPACE%\data_dst\aligned" ^
    --detector s3fd ^
    --output-debug ^
    --force-gpu-idxs 0

pause



Download URL
https://mega.nz/#F!i2hGXYja!mx_afnMuSRyiONKFEY7Zfg


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/


The following batch file can use the previous one as it is.


[font=Verdana, sans-serif]4.2.1) data_src sort by blur.bat[/font]
[font=Verdana, sans-serif]4.2.2) data_src sort by similar histogram.bat[/font]
[font=Verdana, sans-serif]4.2.4) data_src sort by dissimilar histogram.bat[/font]
[font=Verdana, sans-serif]4.2.5) data_src sort by face pitch.bat[/font]
[font=Verdana, sans-serif]4.2.5) data_src sort by face yaw.bat[/font]
[font=Verdana, sans-serif]4.2.6) data_src sort by best.bat[/font]
[font=Verdana, sans-serif]4.2.other) data_src sort by black.bat[/font]
[font=Verdana, sans-serif]4.2.other) data_src sort by brightness.bat[/font]
[font=Verdana, sans-serif]4.2.other) data_src sort by hue.bat[/font]
[font=Verdana, sans-serif]4.2.other) data_src sort by one face in image.bat[/font]
[font=Verdana, sans-serif]4.2.other) data_src sort by original filename.bat[/font]

[font=Verdana, sans-serif]5.3) data_dst sort by blur.bat[/font]
[font=Verdana, sans-serif]5.3) data_dst sort by dissimilar histogram.bat[/font]
[font=Verdana, sans-serif]5.3) data_dst sort by face pitch.bat[/font]
[font=Verdana, sans-serif]5.3) data_dst sort by face yaw.bat[/font]
[font=Verdana, sans-serif]5.3) data_dst sort by similar histogram.bat[/font]
[font=Verdana, sans-serif]5.3.other) data_dst sort by best.bat[/font]
[font=Verdana, sans-serif]5.3.other) data_dst sort by original filename.bat[/font]


Use if you copy the version before 01_11_2020 as it is.

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
A Quick128 model has been created that works with the latest version of DeepFaceLab, 01_25_2020.

The preview is blurry just by trying it lightly,
train, merge confirmed to be completed without error.

Confirmation environment
TITAN RTX VRAM 24GB
RTX2080 VRAM 8GB


Q: What is the randam flip setting?
A: No, false is better for random flip. There is no human who is completely symmetrical in the world, and it is easy to become another person.
A: No, False is recommended unless src is not enough.


Download URL
https://mega.nz/#!jjIgUCjT!XvmuOu2GldOOvRK-Bhho0U0IErum-3FC81OVlb_-ptA


I accept donations for Amazon Japan gift card.
E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
A Quick256 model has been created that works with the latest version of DeepFaceLab, 01_25_2020.

The preview is blurry just by trying it lightly,
train confirmed to be completed without error.

Confirmation environment
TITAN RTX VRAM 24GB
RTX2080 VRAM 8GB


Download URL
https://mega.nz/#F!i2hGXYja!mx_afnMuSRyiONKFEY7Zfg


I accept donations for Amazon Japan gift card.
E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
If you are using RTX,
It seems to work with CUDA 10.0 and cuDNN v7.6.5 with tensorflow-gpu 1.3.1.

CUDA 10.0 installation
https://developer.nvidia.com/cuda-10.0-download-archive
 
cuDNN v7.6.5 installation
https://developer.nvidia.com/cudnn

(Reference) cuDNN old version installation
https://developer.nvidia.com/rdp/cudnn-archive


clear_pycache.bat

@echo off
cd /D %~dp0
call setenv.bat
cd %DFL_ROOT%
rmdir DFLIMG\__pycache__ /s /q
rmdir facelib\__pycache__ /s /q
rmdir localization\__pycache__ /s /q
rmdir mainscripts\__pycache__ /s /q
rmdir merger\__pycache__ /s /q
rmdir models\__pycache__ /s /q
rmdir samplelib\__pycache__ /s /q


May be used for troubleshooting.

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 

aXu

DF Pleb
does not work for extraction. u just replaced the dlls in de cuda folder and the dll in the cudnn folder?
 
In my environment, it is Core i7-8700 + RTX2080.
For example, if you try to run a train,

Choose one or several GPU idxs (separated by comma).

[CPU]: CPU
   [0]: GeForce RTX 2080

It will be displayed.

If you have one graphic board, wouldn't the index of the graphic board be 0?


With DeepFaceLab 2.0, only people with NVIDIA graphics boards are supported.
I think it is a special environment, but if you have two or more NVIDIA graphics boards,
you can specify the index number of the fastest graphics board.


I have installed CUDA 10.0 and cuDNN v7.6.5.
The contents of the setenv.bat file have been rewritten.

rem ========== CUDA ENV ==========
SET PATH =% CUDA_PATH%;% CUDA_PATH% \ bin;% PATH%


Auto Preview (Trainer.py) that works with 01_25_2020 version of DeepFaceLab 2.0 has been created.

Update the preview screen more frequently than the original.

Changed model save interval from 15 minutes to 5 minutes.

As a landmark using the original Trainer.py,
Training preview (Auto Update) is displayed in the title bar above the preview screen.

If you want to change the save interval of the model, open Trainer.py with a text editor or Notepad and search for save_interval_min.
It should be on line 35.
save_interval_min = 5 means save the model every 5 minutes.
If you want to change it, change the number in minutes.
Official builds are saved every 15 minutes.


After copying and pasting the original Trainer.py and backing it up,
Please replace Trainer.py.
Try it once and try it if you like.
Some people like the frequent preview screen updates.
Some people like saving frequent model data.


Download URL
https://mega.nz/#!v6hj2QRC!CB5foZUk4tLo4B1Y5V1CpDP8G9YpBGEPC9c2Hg4GNp0


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
A Quick256 model has been created that works with the latest version of DeepFaceLab, 01_28_2020.

The preview is blurry just by trying it lightly,
train confirmed to be completed without error.

Confirmation environment
TITAN RTX VRAM 24GB


Download URL
[url=https://mega.nz/#!C7IgUILb!R1wfJg3R_wWcoRKZaVLuslc5l7MyVOxLzgiOh7FNi80]https://mega.nz/#!C7IgUILb!R1wfJg3R_wWcoRKZaVLuslc5l7MyVOxLzgiOh7FNi80[/url]


I accept donations for Amazon Japan gift card.
E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/


Since 01_23_2020 version is tensorflow 1.12.0 version, CUDA 10.0 worked.

Since version 01_25_2020 and later are tensorflow 1.13.2 versions, CUDA 10.0 will not work and will be up to CUDA 9.2.

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
I just briefly checked frame extraction, face extraction, face sorting, face enhancement, face pack, train,
People using RTX seem to work with CUDA 10.1, cuDNN 7.6.5, Python 3.7.6.
However, tensorflow-gpu 2.1.0 did not work.
It worked if tensorflow-gpu 1.13.2.
You may want to follow _internal \ DeepFaceLab \ requirements-cuda.txt.
At least the author of DFL has confirmed the operation only up to that version.

The maximum version of packages such as tensorflow-gpu has not been confirmed.


setenv.bat

rem ========== BASE ENV ==========
SET INTERNAL=%~dp0
SET INTERNAL=%INTERNAL:~0,-1%
rem overriding windows user/local environment
SET LOCALENV_DIR=%INTERNAL%\_e
SET TMP=%LOCALENV_DIR%\t
SET TEMP=%LOCALENV_DIR%\t
SET HOME=%LOCALENV_DIR%\u
SET HOMEPATH=%LOCALENV_DIR%\u
SET USERPROFILE=%LOCALENV_DIR%\u
SET LOCALAPPDATA=%USERPROFILE%\AppData\Local
SET APPDATA=%USERPROFILE%\AppData\Roaming

rem ========== PYTHON ENV ==========
SET PYTHON_PATH=%ProgramFiles%\python-3.7.6
rem overriding default python env vars in order not to interfere with any system python installation
SET PYTHONHOME=%ProgramFiles%\python-3.7.6
SET PYTHONPATH=%ProgramFiles%\python-3.7.6
SET PYTHONEXECUTABLE=%PYTHON_PATH%\python.exe
SET PYTHONWEXECUTABLE=%PYTHON_PATH%\pythonw.exe
SET PYTHON_EXECUTABLE=%PYTHON_PATH%\python.exe
SET PYTHONW_EXECUTABLE=%PYTHON_PATH%\pythonw.exe
SET PYTHON_BIN_PATH=%PYTHON_EXECUTABLE%
SET PYTHON_LIB_PATH=%PYTHON_PATH%\Lib\site-packages
SET PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH%

rem ========== CUDA ENV ==========
SET PATH=%CUDA_PATH%;%CUDA_PATH%\bin;%PATH%

rem ========== ADDITIONAL ENV ==========
SET XNVIEWMP_PATH=%ProgramFiles%\XnViewMP
SET FFMPEG_PATH=%ProgramFiles%\ffmpeg;%PATH%
SET PATH=%XNVIEWMP_PATH%;%FFMPEG_PATH%;%PATH%
SET WORKSPACE=%INTERNAL%\..\workspace
SET DFL_ROOT=%INTERNAL%\DeepFaceLab
SET TF_MIN_REQ_CAP=30


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/


Auto Preview (Trainer.py) that works with 01_28_2020 version of DeepFaceLab 2.0 has been created.

Update the preview screen more frequently than the original.

Changed model save interval from 15 minutes to 5 minutes.

As a landmark using the original Trainer.py,
Training preview (Auto Update) is displayed in the title bar above the preview screen.

If you want to change the save interval of the model, open Trainer.py with a text editor or Notepad and search for save_interval_min.
It should be on line 35.
save_interval_min = 5 means save the model every 5 minutes.
If you want to change it, change the number in minutes.
Official builds are saved every 15 minutes.


After copying and pasting the original Trainer.py and backing it up,
Please replace Trainer.py.
Try it once and try it if you like.
Some people like the frequent preview screen updates.
Some people like saving frequent model data.


Download URL
[url=https://mega.nz/#!qqhxzQRB!tcxZYW44Tio0pXtQXrl9YLf4zW1PdWeafP0MIg4UYg0]https://mega.nz/#!qqhxzQRB!tcxZYW44Tio0pXtQXrl9YLf4zW1PdWeafP0MIg4UYg0[/url]


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/


7) Since the contents of merge Quick96.bat were changed,
7) merge Quick128.bat and 7) merge Quick256.bat recreated
7) Copy and paste merge Quick96.bat, 7) Rename merge Quick128.bat.
7) Change --model Quick96 in merge Quick128.bat to --model Quick128


Download URL
https://mega.nz/#!avAkDSqC!wKrZeTgTHYPJWeCuX-0EUoACM6nDtW0RtkngURaVth4


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
Automate input of bit rate of 8) merged to mp4.bat has been created that works with the latest version of DeepFaceLab, 01_28_2020.

It is recommended for those who input the bit rate of 8) merged to mp4.bat and set the default by Enter.
You need grep and gawk to make it work.
These are installed, for example, if you install MSYS2 (msys64).
This is unnecessary for those who are looking for the right bitrate from data_dst.mp4.


Download URL
https://mega.nz/#!zmAz1YIA!4DserSDsFLUP8puM9WWbEORrT9WuAZHeVBOnPnjuLjk


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/

Mod edited: This is an unsupported modification to DFL. The original developer does not support modifications outside of his github found here. Donations to the original developer iperov can be found on his github.
 
At least in the 01_30_2020 version, CUDA 10.1, cuDNN 7.6.5, Python 3.7.6 no longer work.
Right now, RTX uses what is inside DFL.
CUDA 9.2, python-3.6.8.
 
Automate input of bit rate of 8) merged to mp4.bat.
It is recommended for those who input the bit rate of 8) merged to mp4.bat and set the default by Enter.
You need grep and gawk to make it work.
These are installed, for example, if you install MSYS2 (msys64).
This is unnecessary for those who are looking for the right bitrate from data_dst.mp4.


Download URL
https://mega.nz/#F!G2oTnbTb!55lfsnJfOJOX0WzKDKq_lw


I accept donations for Amazon Japan gift card.

E-mail: tomoe.magica@gmail.com

https://www.amazon.co.jp/
 
Automatically delete unextracted face images from aligned_debug folder before 5) data_dst extract full_face MANUAL RE-EXTRACT DELETED ALIGNED_DEBUG.bat


5) data_dst delete no landmark ALIGNED_DEBUG.bat

@echo off
call _internal\setenv.bat
chdir /d "%WORKSPACE%\data_dst\aligned_debug"
echo please wait...
for %%F in (*.jpg) do call :sub "%%F"
pause
exit

:sub
set filename=%~n1
if not exist %WORKSPACE%\data_dst\aligned\%filename%*.jpg (del %WORKSPACE%\data_dst\aligned_debug\%filename%*.* echo %1)
goto :eof
 

TMBDF

Moderator | Deepfake Creator | Guide maintainer
Staff member
Moderator
Verified Video Creator
tomoe_magica said:
Automatically delete unextracted face images from aligned_debug folder before 5) data_dst extract full_face MANUAL RE-EXTRACT DELETED ALIGNED_DEBUG.bat


5) data_dst delete no landmark ALIGNED_DEBUG.bat

@echo off
call _internal\setenv.bat
chdir /d "%WORKSPACE%\data_dst\aligned_debug"
echo please wait...
for %%F in (*.jpg) do call :sub "%%F"
pause
exit

:sub
set filename=%~n1
if not exist %WORKSPACE%\data_dst\aligned\%filename%*.jpg (del %WORKSPACE%\data_dst\aligned_debug\%filename%*.* echo %1)
goto :eof

So basically this removes frames from aligned_debug that have no landmarks/faces extracted from right?
 
Remove frames without aligned landmarks / faces from aligned_debug.

Delete aligned_debug corresponding to faces that were not extracted in aligned.
aligned_debug should have no facial landmarks or facial masks.
Delete the alignment_debug that does not have a face landmark or a face mask.


Please do not sort data_dst\aligned and do not change the file name.

This batch file works before renaming the file.

If data_dst\aligned is sorted, the correspondence of aligned_debug to the file name will be lost.


The removed alignment_debug does not contain any facial landmarks or facial masks.


You do not need to manually remove alignment_debug.
With this batch,
The alignment_debug that has not been extracted as a face is automatically deleted.

Then you can run the following.
5) data_dst extract full_face MANUAL RE-EXTRACT DELETED ALIGNED_DEBUG.bat
 
Status
Not open for further replies.
Top