1
0
Fork 0
mirror of https://github.com/deepfakes/faceswap synced 2025-06-09 04:36:50 -04:00
Commit graph

55 commits

Author SHA1 Message Date
torzdf
f897562a09 Set minimum python version to 3.7 2020-08-18 19:10:56 +01:00
torzdf
d8557c1970
Faceswap 2.0 (#1045)
* Core Updates
    - Remove lib.utils.keras_backend_quiet and replace with get_backend() where relevant
    - Document lib.gpu_stats and lib.sys_info
    - Remove call to GPUStats.is_plaidml from convert and replace with get_backend()
    - lib.gui.menu - typofix

* Update Dependencies
Bump Tensorflow Version Check

* Port extraction to tf2

* Add custom import finder for loading Keras or tf.keras depending on backend

* Add `tensorflow` to KerasFinder search path

* Basic TF2 training running

* model.initializers - docstring fix

* Fix and pass tests for tf2

* Replace Keras backend tests with faceswap backend tests

* Initial optimizers update

* Monkey patch tf.keras optimizer

* Remove custom Adam Optimizers and Memory Saving Gradients

* Remove multi-gpu option. Add Distribution to cli

* plugins.train.model._base: Add Mirror, Central and Default distribution strategies

* Update tensorboard kwargs for tf2

* Penalized Loss - Fix for TF2 and AMD

* Fix syntax for tf2.1

* requirements typo fix

* Explicit None for clipnorm if using a distribution strategy

* Fix penalized loss for distribution strategies

* Update Dlight

* typo fix

* Pin to TF2.2

* setup.py - Install tensorflow from pip if not available in Conda

* Add reduction options and set default for mirrored distribution strategy

* Explicitly use default strategy rather than nullcontext

* lib.model.backup_restore documentation

* Remove mirrored strategy reduction method and default based on OS

* Initial restructure - training

* Remove PingPong
Start model.base refactor

* Model saving and resuming enabled

* More tidying up of model.base

* Enable backup and snapshotting

* Re-enable state file
Remove loss names from state file
Fix print loss function
Set snapshot iterations correctly

* Revert original model to Keras Model structure rather than custom layer
Output full model and sub model summary
Change NNBlocks to callables rather than custom keras layers

* Apply custom Conv2D layer

* Finalize NNBlock restructure
Update Dfaker blocks

* Fix reloading model under a different distribution strategy

* Pass command line arguments through to trainer

* Remove training_opts from model and reference params directly

* Tidy up model __init__

* Re-enable tensorboard logging
Suppress "Model Not Compiled" warning

* Fix timelapse

* lib.model.nnblocks - Bugfix residual block
Port dfaker
bugfix original

* dfl-h128 ported

* DFL SAE ported

* IAE Ported

* dlight ported

* port lightweight

* realface ported

* unbalanced ported

* villain ported

* lib.cli.args - Update Batchsize + move allow_growth to config

* Remove output shape definition
Get image sizes per side rather than globally

* Strip mask input from encoder

* Fix learn mask and output learned mask to preview

* Trigger Allow Growth prior to setting strategy

* Fix GUI Graphing

* GUI - Display batchsize correctly + fix training graphs

* Fix penalized loss

* Enable mixed precision training

* Update analysis displayed batch to match input

* Penalized Loss - Multi-GPU Fix

* Fix all losses for TF2

* Fix Reflect Padding

* Allow different input size for each side of the model

* Fix conv-aware initialization on reload

* Switch allow_growth order

* Move mixed_precision to cli

* Remove distrubution strategies

* Compile penalized loss sub-function into LossContainer

* Bump default save interval to 250
Generate preview on first iteration but don't save
Fix iterations to start at 1 instead of 0
Remove training deprecation warnings
Bump some scripts.train loglevels

* Add ability to refresh preview on demand on pop-up window

* Enable refresh of training preview from GUI

* Fix Convert
Debug logging in Initializers

* Fix Preview Tool

* Update Legacy TF1 weights to TF2
Catch stats error on loading stats with missing logs

* lib.gui.popup_configure - Make more responsive + document

* Multiple Outputs supported in trainer
Original Model - Mask output bugfix

* Make universal inference model for convert
Remove scaling from penalized mask loss (now handled at input to y_true)

* Fix inference model to work properly with all models

* Fix multi-scale output for convert

* Fix clipnorm issue with distribution strategies
Edit error message on OOM

* Update plaidml losses

* Add missing file

* Disable gmsd loss for plaidnl

* PlaidML - Basic training working

* clipnorm rewriting for mixed-precision

* Inference model creation bugfixes

* Remove debug code

* Bugfix: Default clipnorm to 1.0

* Remove all mask inputs from training code

* Remove mask inputs from convert

* GUI - Analysis Tab - Docstrings

* Fix rate in totals row

* lib.gui - Only update display pages if they have focus

* Save the model on first iteration

* plaidml - Fix SSIM loss with penalized loss

* tools.alignments - Remove manual and fix jobs

* GUI - Remove case formatting on help text

* gui MultiSelect custom widget - Set default values on init

* vgg_face2 - Move to plugins.extract.recognition and use plugins._base base class
cli - Add global GPU Exclude Option
tools.sort - Use global GPU Exlude option for backend
lib.model.session - Exclude all GPUs when running in CPU mode
lib.cli.launcher - Set backend to CPU mode when all GPUs excluded

* Cascade excluded devices to GPU Stats

* Explicit GPU selection for Train and Convert

* Reduce Tensorflow Min GPU Multiprocessor Count to 4

* remove compat.v1 code from extract

* Force TF to skip mixed precision compatibility check if GPUs have been filtered

* Add notes to config for non-working AMD losses

* Rasie error if forcing extract to CPU mode

* Fix loading of legace dfl-sae weights + dfl-sae typo fix

* Remove unused requirements
Update sphinx requirements
Fix broken rst file locations

* docs: lib.gui.display

* clipnorm amd condition check

* documentation - gui.display_analysis

* Documentation - gui.popup_configure

* Documentation - lib.logger

* Documentation - lib.model.initializers

* Documentation - lib.model.layers

* Documentation - lib.model.losses

* Documentation - lib.model.nn_blocks

* Documetation - lib.model.normalization

* Documentation - lib.model.session

* Documentation - lib.plaidml_stats

* Documentation: lib.training_data

* Documentation: lib.utils

* Documentation: plugins.train.model._base

* GUI Stats: prevent stats from using GPU

* Documentation - Original Model

* Documentation: plugins.model.trainer._base

* linting

* unit tests: initializers + losses

* unit tests: nn_blocks

* bugfix - Exclude gpu devices in train, not include

* Enable Exclude-Gpus in Extract

* Enable exclude gpus in tools

* Disallow multiple plugin types in a single model folder

* Automatically add exclude_gpus argument in for cpu backends

* Cpu backend fixes

* Relax optimizer test threshold

* Default Train settings - Set mask to Extended

* Update Extractor cli help text
Update to Python 3.8

* Fix FAN to run on CPU

* lib.plaidml_tools - typofix

* Linux installer - check for curl

* linux installer - typo fix
2020-08-12 10:36:41 +01:00
torzdf
8a19d21ace setup.py - Fix conda-forge imports
Remove unused icons
2020-07-11 17:54:48 +01:00
torzdf
127d3dbe99
Dependencies update (#1028)
* Dependencies update
  - Split requirements.txt into separate version files
  - More flexible package pinning
  - Update dependencies
  - Fix pynvml being constantly re-downloaded on update
  - Update dockerfiles
  - update INSTALL.md
2020-05-31 16:25:36 +01:00
torzdf
04b3f860a5 setup.py - pin plaidml to 0.6.4 2020-01-20 00:05:34 +00:00
torzdf
ef03be1706
Update Dependencies (#950)
* 1st Round update for Python 3.7, TF1.15, Keras2.3
    Move Tensorflow logging verbosity prior to first tensorflow import
    Keras Optimizers and nn_block update
    lib.logger - Change tf deprecation messages from WARNING to DEBUG
    Raise Tensorflow Max version check to 1.15
    Update requirements and conda check for python 3.7+
    Update install scripts, travis and documentation to Python 3.7

* Revert Keras to 2.2.4
2019-12-10 02:01:20 +00:00
torzdf
701b2f1f51 Minor Fixes
scripts.train - default to .fsa alignments file
setup.py - Lower non-root message to info level
2019-10-25 17:18:04 +00:00
torzdf
b8598be2b6 More seamless AMD Integration
- utils.py: Set FS backend if .faceswap config file doesn't exist
- setup.py: set .faceswap config on setup
- Dynamically load options for AMD/CPU/NVIDIA backends
2019-08-17 19:16:43 +00:00
torzdf
ec505f2ad9 Tensorflow 1.14 Support
Fix Keras Tensorboard callback for TF1.14
Default install on CPU to TF 1.14.0
Default Conda install to TF 1.14.0
Move pynvx for macOS to conditional requirements.txt
2019-08-17 00:11:58 +00:00
kilroythethird
62c1d4346f Catch 0 size images earlier + plaidml version + minor gui update (#829) 2019-08-07 11:15:05 +01:00
kilroythethird
83f2326fd6 pinned plaidml version (#824) 2019-08-05 18:53:42 +01:00
torzdf
45424d452f Fixups
requirements.txt: Pin Pillow to 6.1.0
setup.py: Don't query Conda for Git requirements
AMD: List whether device is supported or experimental
2019-08-05 14:38:14 +01:00
torzdf
3f20b79492 Revert install to pip opencv 2019-07-27 23:23:36 +01:00
torzdf
044832769a setup.py: Don't error out if cudnn can't be found on linux 2019-07-03 16:40:53 +00:00
torzdf
76d18c87d7 Fixups
Dependency Updater: Improve by pluging in to setup.py
setup.py: Bugfix handling of Conda aliases
GUI: Revert console background colour
sysinfo: Handle errors in obtaining information
2019-07-03 11:07:21 +00:00
torzdf
17427322a8 Migrate more imports from PyPi to Conda 2019-06-30 10:47:21 +01:00
torzdf
7ee48c07d0 setup.py typo fix 2019-06-29 23:40:42 +01:00
torzdf
b45680ef1c installer and setup.py updates 2019-06-30 00:19:04 +01:00
torzdf
f5dd18352c Fixups
- GPUStats: Add more useful advice for pynvml errors
- Setup.py - Fix missing Cuda Path on Windows
- Setup.py - Handle Nonetype error on required packages
2019-06-28 18:34:23 +01:00
torzdf
68d6862a3e Merge branch 'master' into plaidml 2019-06-24 00:32:24 +01:00
torzdf
79a61002b5 Update Dependencies Script
- Add script `update_deps.py` to automatically update dependencies
- Call update_deps.py when checking for updates from the GUI
- Update setup.py to respect requirements.txt sys_platform tags
- Update INSTALL.md
2019-06-24 00:31:47 +01:00
torzdf
9d33341e20 Merge branch 'master' into staging 2019-06-21 14:30:36 +01:00
torzdf
3c040e3ccd Filetype Bugfix + Max TF Version
- Fix bug for uppercase video filetypes
- Set maximum supported Tensorflow version to 1.13
2019-06-21 14:30:23 +01:00
torzdf
779dd60280
Experimental AMD Support (#764)
* PlaidML support in setup.py

* Add AMD flag for plaidml support

* PlaidML - Use .plaidML file if present, otherwise default to largest available

* Update training info message for GUI

* Add AMD option to Windows Installer

* Add quiet keras.backend importer and minor sysinfo amend.

* plug PlaidMLStats into GPUStats

* Update Docs
2019-06-19 18:18:31 +01:00
torzdf
b03f44827c Full RTX Support
Remove FFMPEG from Conda Requirements
Fix Tensorboard logging for Tensorflow 1.13.1
Bump default Conda Tensorflow to 1.13.1
Update max python version to 3.7
2019-06-12 19:20:53 +01:00
wallopthecat
4fe93da530 small fix for docker cmd. tools.py->faceswap.py (#749) 2019-06-03 18:15:26 +01:00
torzdf
12d83c6e68
Remove dlib (#725)
* Sort to vgg_face. Remove Face Recognition requirements

* Remove dlib components from setup.py

* Remove dlib from Windows Installer script

* Remove dlib and cmake from requirements.txt

* Update INSTALL.md to remove all dlib requirements

* Remove dlib and cmake from dockerfiles

* Windows installer. Output cli to details Window. Setup.py bugfix

* Skip FaceFilter if invalid paths passed in
2019-05-12 23:24:25 +01:00
torzdf
9c8026409c Windows cudnn check bugfix 2019-04-30 08:47:24 +00:00
torzdf
520a784847 Better cuDNN/Cuda Detection 2019-04-29 11:46:07 +00:00
torzdf
32eec5140d setup.py fixes 2019-03-21 12:20:42 +00:00
torzdf
1f8da1d784 Tensorflow version check 2019-02-28 10:53:00 +00:00
DKing
cebf552dc5 Update Dockerfile due to the missing of jupyter in the latest tensorflow gpu image (#625)
Add tips for CUDA 10
2019-02-26 14:34:43 +00:00
torzdf
82130caee1 Remove unused import 2019-02-24 03:29:32 +00:00
torzdf
01df9c1090 Convert FAN to run on CPU as well as GPU 2019-02-24 03:23:53 +00:00
torzdf
c70fa8a8b4 Remove debug info 2019-02-22 14:43:12 +00:00
torzdf
051619c6b2 Update setup.py for Conda 2019-02-22 14:40:50 +00:00
torzdf
d39216d2e3 setup typo 2019-02-22 01:01:18 +00:00
torzdf
40155a27e2 Windows Installer Source Code 2019-02-22 00:51:27 +00:00
torzdf
a8a70b6ce6 verbose conda TF install 2019-02-21 16:29:16 +00:00
torzdf
424c451586 Requirements file location bugfix 2019-02-21 16:14:53 +00:00
torzdf
d6dfbf1203 Update setup.py to support installer 2019-02-21 12:07:00 +00:00
torzdf
a8826e2a56 Cuda path check bugfix in setup.py 2019-01-08 14:04:25 +00:00
torzdf
960c75f3c6 setup.py: Install ffmpeg on Conda 2018-12-22 19:56:13 +00:00
torzdf
9fbaaa5d38 setup.py - Get system encoding 2018-12-11 12:51:19 +00:00
torzdf
7d89961113 Secondary Registry key check for VS C++ 2015 2018-12-06 02:00:33 +00:00
torzdf
7f53911453
Logging (#541)
* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training
2018-12-04 13:31:49 +00:00
torzdf
542c6524cc fix vs2015 detection in setup.py 2018-11-24 23:06:22 +00:00
torzdf
c08e45b996 Final setup.py changes 2018-11-17 00:48:25 +00:00
torzdf
3e6b78e9bb Add gcc/g++ checks for linux. Add more informative output 2018-11-16 18:24:16 +00:00
torzdf
d1705b08cd Improve setup.py for Windows 2018-11-16 17:31:27 +00:00