58 Commits

Author SHA1 Message Date
torzdf 815b11f104 Migrate optimizers to torch (#1547) 2026-05-21 08:44:57 +01:00
torzdf a0ff721004 Completely remove Keras from loss calculations (#1545)
* training: Completely remove Keras from loss calculations
2026-05-09 19:07:30 +01:00
torzdf dd25f4533a All loss functions to Torch 2026-04-23 16:35:20 +01:00
torzdf 16fea0ebff Most loss functions to torch 2026-04-21 19:14:55 +01:00
torzdf e6ae291cd4 lpips: To torch + crop feature map zero-padding 2026-04-20 09:15:26 +01:00
torzdf 83fdd5f938 Train: Migrate data loading to Torch (#1540) 2026-04-16 19:19:53 +01:00
torzdf 453ef58b1d bugfix: alignments tool unit test 2026-04-08 10:07:47 +01:00
torzdf 32f427c00c Alignments: Migrate typed-dicts to dataclasses 2026-04-05 12:10:05 +01:00
torzdf cb2eace572 Remove legacy face set support 2026-03-31 00:03:05 +01:00
torzdf 0a0d1fabf0 convert bugfixes:
- ffmpeg writer: Exit audio buffer when no audio available
  - convert: correctly apply y-offset
  - Fix color adjust when "none" selected
2026-03-28 14:13:10 +00:00
torzdf 28ebca5c88 Fix Preview viewer test 2026-03-27 15:57:00 +00:00
torzdf d21781264d Extraction Overhaul (#1533)
* Extract refactor
2026-03-20 23:52:37 +00:00
torzdf 837bc2d51d Faceswap 3 (#1516)
* FaceSwap 3 (#1515)
* Update extract pipeline
* Update requirements + setup for nvidia
* Remove allow-growth option
* tf.keras to keras updates
* lib.model.losses - Port + fix all loss functions for Keras3
* lib.model - port initializers, layers. normalization to Keras3
* lib.model.autoclip to Keras 3
* Update mixed precision layer storage
* model file to .keras format
* Restructure nn_blocks to initialize layers in __init__
* Tensorboard
  - Trainer: Add Torch compatible Tensorboard callbacks
  - GUI event reader remove TF dependency
* Loss logging
  - Flush TB logs on save
  - Replace TB live iterator for GUI
* Backup models on total loss drop rather than per side
* Update all models to Keras3 Compat
* Remove lib.model.session
* Update clip ViT to Keras 3
* plugins.extract.mask.unet-dfl - Fix for Keras3/Torch backend
* Port AdaBelief to Keras 3
* setup.py:
  - Add --dev flag for dev tool install
* Fix Keras 3 syntax
* Fix LR Finder for Keras 3
* Fix mixed precision switching for Keras  3
* Add more optimizers + open up config setting
* train: Remove updating FS1 weights to FS2 models
* Alignments: Remove support for legacy .json files
* tools.model:
  - Remove TF Saved Format saving
  - Fix Backup/Restore + Nan-Scan
* Fix inference model creation for Keras 3
* Preview tool: Fix for Keras3
* setup.py: Configure keras backend
* train: Migration of FS2 models to FS3
* Training: Default coverage to 100%
* Remove DirectML backend
* Update setup for MacOS
* GUI: Force line reading to UTF-8
* Remove redundant Tensorflow references
* Remove redundant code
* Legacy model loading: Fix TFLamdaOp scalar ops and DepthwiseConv2D
* Add vertical offset option for training
* Github actions: Add more python versions
* Add python version to workflow names
* Github workflow: Exclude Python 3.12 for macOS
* Implement custom training loop
* Fs3 - Add RTX5xxx and ROCm 6.1-6.4 support (#1511)
* setup.py: Add Cuda/ROCm version select options
* bump minimum python version to 3.11
* Switch from setup.cgf to pyproject.toml
* Documentation: Update all docs to use automodapi
* Allow sysinfo to run with missing packages + correctly install tk under Linux
* Bugfix: dot naming convention in clip models
* lib.config: Centralise globally rather than passing as object
- Add torch DataParallel for multi-gpu training
  - GUI: Group switches together when generating cli args
  - CLI: Remove deprecated multi-character argparse args
  - Refactor:
    - Centralise tensorboard reading/writing + unit tests
    - Create trainer plugin interfaces + add original + distributed
* Update installers
2025-12-21 02:45:11 +00:00
torzdf ec2a95adf6 tests: Fix alignment tool process_video test 2024-04-17 14:02:43 +01:00
torzdf 118e615724 bugfix: tests - change -it switch to -i 2024-04-06 16:53:12 +01:00
torzdf b1caa03e3f Fix tests for new cli switches 2024-04-06 15:48:54 +01:00
torzdf cf0efff6ba Learning Rate finder (#1341)
* Add LR Finder support structure

* Move trainer.Feeder to lib.training.generator

* Expose model.io

* Add lr_finder

* Update docs and locales

* Pre-PR fixups
  - Fix training graph not displaying
  - CI fixes
  - Switch lr finder progress to tqdm
  - Exit lr finder early on NaN
  - Display lr finder progress in GUI
2023-08-22 17:07:36 +01:00
torzdf c4204c7d8a Updates:
- Remove clipfaker
    - Add clip to Phaze-A
    - streamline clip to vision only
    - update lib.model.networks
    - Docs and tests update
    - Phaze-A - add option to flatten bottleneck
2023-07-08 17:20:39 +01:00
torzdf 6a3b4ed4b3 Training fixes:
- Fix mixed precision layer storing and switching
  - typofix in _requirements_base.txt
  - lib.model.layers - cleanup, docs and tests fixes
  - lib.model.nn_blocks - typing fixes
2023-07-08 16:47:25 +01:00
torzdf 6a3b674bef Rebase code (#1326)
* Remove tensorflow_probability requirement

* setup.py - fix progress bars

* requirements.txt: Remove pre python 3.9 packages

* update apple requirements.txt

* update INSTALL.md

* Remove python<3.9 code

* setup.py - fix Windows Installer

* typing: python3.9 compliant

* Update pytest and readthedocs python versions

* typing fixes

* Python Version updates
  - Reduce max version to 3.10
  - Default to 3.10 in installers
  - Remove incompatible 3.11 tests

* Update dependencies

* Downgrade imageio dep for Windows

* typing: merge optional unions and fixes

* Updates
  - min python version 3.10
  - typing to python 3.10 spec
  - remove pre-tf2.10 code
  - Add conda tests

* train: re-enable optimizer saving

* Update dockerfiles

* Update setup.py
  - Apple Conda deps to setup.py
  - Better Cuda + dependency handling

* bugfix: Patch logging to prevent Autograph errors

* Update dockerfiles

* Setup.py - Setup.py - stdout to utf-8

* Add more OSes to github Actions

* suppress mac-os end to end test
2023-06-27 11:27:47 +01:00
torzdf e4ba12ad2a tests: Fix event-reader test 2023-06-21 22:51:59 +01:00
torzdf 03f5c671bc Remove plaidML support (#1325)
* Remove PlaidML reference from readme files

* Remove AMD option from installers

* remove amd requirements and update setup.py

* remove plaidml test from CI workflow

* gpustats: remove plaidml backend

* plaid removals:
  - faceswap.py - python version check
  - setup.cfg - plaidml typing ignore
  - lib.keras_utils - All plaid code
  - lib.launcher.py - All plaidml checks and configuration

* remove tf2.2 specific code from GUI event reader

* lib.model - remove all plaidml implementations

* plugins.extract - remove plaidml code

* plugins.train remove plaidml code

* lib.convert - remove plaidml code

* tools.model: remove plaidml code

* Remove plaidML tests from unit tests

* remove plaidml_utils and docsting cleanups

* Remove plaidML refs from configs

* fix keras imports
2023-06-21 12:57:33 +01:00
torzdf cd929e0df3 bugfix: preview tool unit test 2023-02-20 12:28:02 +00:00
torzdf 637dc3b55c bugfix - utils unit test 2023-02-20 12:12:51 +00:00
torzdf a1ef5edd39 tests:
- unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes
2023-01-21 00:41:18 +00:00
torzdf 798e59192c unit test updates
- Add XVFB (virtual display)
  - Re-activate viewer gui test
2023-01-17 16:20:16 +00:00
torzdf 110f53d5a4 bugfix - skip tkinter unit tests 2023-01-17 15:24:14 +00:00
torzdf 34b558426e bugfix:
- preview tool - Prevent tkinter variables from exiting main thread
refactor:
    - preview tool - Split module to smaller sub-modules + docs, locales
Typing:
    - tools.preview.cli
Unit test:
    - tools.preview.viewer
2023-01-17 15:03:29 +00:00
torzdf 80f63280ca Bugfixes
- plugin.train.unbalanced - decoder b
  - gui.stats - crash when log folder deleted
  - setup.py - install gcc=12.1.0 on linux (scipy dep)
  - setup.py - don't test ROCm unless valid
  - typofix - cli_args extract singleprocess help
typing
  - lib.gui.analysis.event_reader
  - lib.gpu_stats.directml - make platform specific
unit tests
  - lib.gui.analysis.event_reader
2023-01-13 23:29:51 +00:00
torzdf 0dbeafb195 bugfix: sysinfo
- Fix getting free Vram on Nvidia
  - Don't halt sysinfo on GPU stats error
  - lib.sysinfo unit test
2023-01-09 12:29:18 +00:00
torzdf dc94ed9cad DirectML Support (#1291)
* DML Support
  - Add requirements. Update setup.py. Update Windows Installer
  - Add 'directml' backend. Update backend supporting logic
  - GPUStats - Add GPU querying from Win SDK for DML backend
  - Windows PlaidML - Deprecation Warning
  - Remove deprecated '-d' training flag
  - Logging in DML functions
- Unittest
  - Windows Unit Test
  - lib.utils
2023-01-06 14:45:57 +00:00
torzdf ddedb52696 Update tests for tf2.10 2022-12-20 15:35:10 +00:00
torzdf 765e385177 Extract: Typing and standardization 2022-09-30 18:36:35 +01:00
torzdf 26e26c6288 Update TF to 2.9
- Update TF to 2.7 to 2.9
    - Bump dependencies
    - Remove decode from pynvml calls
    - force keras predict functions to non-verbose
    - update tests
    - update Tensorboard logging
    - Update docs
2022-08-02 17:12:26 +01:00
torzdf 582c2ce40c Add Flip Loss Function
- Add Flip for AMD and TF
    - Split Perceptual Loss functions to own modules
    - Fix allowed input shape for models
    - Allow GUI tooltip to display at higher width
2022-07-07 01:02:11 +01:00
torzdf 1d434b73a4 Enable LogCosh Loss for AMD 2022-06-18 16:12:39 +01:00
torzdf 308c5edf39 Loss updates
- Split Loss to own package
  - Add Focal Frequency Loss (Nvidia only)
  - Enable GMSD for AMD
2022-06-18 14:33:45 +01:00
torzdf d9c84a5f9f Add Laplacian Pyramid Loss 2022-06-18 02:29:19 +01:00
torzdf 04337e0c5e SSIM Updates
- Standardize DSSIM Function
  - Implement MSSIM function for AMD
2022-06-18 00:02:28 +01:00
torzdf d02d51f2bb doc fixes 2022-06-17 22:01:57 +01:00
torzdf 98a65277d8 Fix AMD Tests + docs 2022-06-17 17:59:55 +01:00
torzdf ff6b0209dd Refactoring and TravisCI to Github Actions (#1239)
* refactor training

* travis to actions
2022-06-17 03:24:16 +01:00
torzdf 20a657d6cf Bump minimum TF Version 2022-06-07 10:54:51 +01:00
torzdf 1f5561795a update losses test 2022-05-04 09:56:48 +01:00
torzdf aa39234538 Update all Keras Imports to be conditional (#1214)
* Remove custom keras importer

* first round keras imports fix

* launcher.py: Remove KerasFinder references

* 2nd round keras imports update (lib and extract)

* 3rd round keras imports update (train)

* remove KerasFinder from tests

* 4th round keras imports update (tests)
2022-05-03 20:18:39 +01:00
torzdf c1512fd41d Update code to support Tensorflow versions up to 2.8 (#1213)
* Update maximum tf version in setup + requirements

* - bump max version of tf version in launcher
- standardise tf version check

* update keras get_custom_objects  for tf>2.6

* bugfix: force black text in GUI file dialogs (linux)

* dssim loss - Move to stock tf.ssim function

* Update optimizer imports for compatibility

* fix logging for tf2.8

* Fix GUI graphing for TF2.8

* update tests

* bump requirements.txt versions

* Remove limit on nvidia-ml-py

* Graphing bugfixes
  - Prevent live graph from displaying if data not yet available

* bugfix: Live graph. Collect loss labels correctly

* fix: live graph - swallow inconsistent loss errors

* Bugfix: Prevent live graph from clearing during training

* Fix graphing for AMD
2022-05-02 14:30:43 +01:00
torzdf 8c87ac52b4 Update Travis Tests for optimizers 2021-05-25 13:12:18 +00:00
torzdf 4c1631b58e lib.model - Add AdaBelief Optimizer 2021-05-25 13:11:35 +01:00
torzdf 69813de15a Unit tests - lib.model.normalization
- __init__.py - Explicit imports (to fix pytests)
  - Add tests for all existing normalization layers
  - fix GroupNormalization for tensorflow backend
2021-02-17 12:19:11 +00:00
torzdf 02336977dc lib.model.normalization:
- refactor
  - add LayerNorm
  - add RMSNorm
2021-02-17 00:21:18 +00:00