52 Commits

Author SHA1 Message Date
torzdf 00a2d77f3d bugfix: train data loading - resize function for arbitrary channels 2026-07-05 09:50:43 +01:00
torzdf 6923cd2074 bugfix: lpips - disable grad 2026-05-22 16:54:11 +01:00
torzdf 53b2fd9f1e bugfix: Set color order for relevant loss functions 2026-05-22 12:09:05 +01:00
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 758a44a187 bugfix: GUI loading projects with removed options 2026-04-24 16:58:28 +01:00
torzdf 83fdd5f938 Train: Migrate data loading to Torch (#1540) 2026-04-16 19:19:53 +01:00
torzdf 32f427c00c Alignments: Migrate typed-dicts to dataclasses 2026-04-05 12:10:05 +01: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 381b06f6d3 training: Add Learning Rate Warmup 2025-11-21 17:52:45 +00:00
torzdf 05857b63e1 bugfix: Correctly set learning rate from LR Finder when resuming 2025-11-21 15:19:12 +00:00
torzdf b16b755d55 lr-finder: Log error on NaN 2025-10-23 18:18:39 +01:00
torzdf 696692dc08 Fixups
- Deprecations - display correct long argument
  - Minor spelling + linting
2024-04-21 16:22:42 +01:00
torzdf 2bad105dc8 bugfix: Alignment tool, auto-detect alignments
- Random linting and typing
2024-04-19 11:33:52 +01:00
torzdf 1c081aea7d Add ability to export and import alignment data (#1383)
* tools.alignments - add export job

* plugins.extract: Update __repr__ for ExtractorBatch dataclass

* plugins.extract: Initial implementation of external import plugins

* plugins.extract: Disable lm masks on ROI alignment data import

* lib.align: Add `landmark_type` property to AlignedFace and return dummy data for ROI Landmarks pose estimate

* plugins.extract: Add centering config item for align import and fix filename mapping for images

* plugins.extract: Log warning on downstream plugins on limited alignment data

* tools: Fix plugins for 4 point ROI landmarks (alignments, sort, mask)

* tools.manual: Fix for 2D-4 ROI landmarks

* training: Fix for 4 point ROI landmarks

* lib.convert: Average color plugin. Avoid divide by zero errors

* extract - external:
  - Default detector to 'external' when importing alignments
  - Handle different frame origin co-ordinates

* alignments: Store video extension in alignments file

* plugins.extract.external: Handle video file keys

* plugins.extract.external: Output warning if missing data

* locales + docs

* plugins.extract.align.external: Roll the corner points to top-left for different origins

* Clean up

* linting fix
2024-04-15 12:19:15 +01:00
torzdf 983901466f linting: Reduce Class min-public-methods and fix spacing 2024-04-03 14:37:48 +01:00
torzdf a9d87ae007 linting: Remove pylint hint for logger 2024-04-03 14:03:54 +01:00
torzdf 4502824481 Add mask dilation/erosion option for training 2024-03-26 18:06:48 +00:00
torzdf 180fe97a52 lib.training - Outpu useful error message if non-faceswap training images used 2024-03-22 12:51:50 +00:00
torzdf 48aca1462a bugfix: LR finder. Reset optimizer state 2023-09-08 09:48:09 +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 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 74f4b6f9c4 Bugfix: Preview fail on input size > output size 2023-02-16 19:18:52 +00:00
torzdf 2028579756 Preview - Allow mask color/opacity configuration
- typing: lib.config
  - docs: lib.config
  - bugfix: popup_configure - keep assets on top
2023-02-13 15:03:34 +00:00
torzdf a1ef5edd39 tests:
- unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes
2023-01-21 00:41: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 2e8ef5e3c8 GUI - Preview updates
- Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews
2022-10-20 18:51:39 +01:00
torzdf 765e385177 Extract: Typing and standardization 2022-09-30 18:36:35 +01:00
torzdf 42a010b17a bugfix: Windows Mousewheel in preview 2022-09-07 19:33:56 +01:00
torzdf 7da2cc3dd2 Training - Use custom preview pop-out 2022-09-07 11:49:52 +01:00
torzdf 681b775c7b bugfix: preview color order for RGB models 2022-09-07 10:58:32 +01:00
torzdf de1068b417 Bugfix: Preview - show predictions at correct size 2022-08-30 12:39:39 +01:00
torzdf fe8e34f99e bugfix: Generator for AMD 2022-08-29 01:48:20 +01:00
torzdf f3b88d5626 bugfix: Get correct output size for learn mask 2022-08-29 01:04:40 +01:00
torzdf 2a7c18ac1d bugfixes:
- lib.training: Correct  input + output size for pre-existing models
  - lib.align.detected_faces - fix trace logging
  - lib.util.debug_times
2022-08-28 12:25:30 +01:00
torzdf 326110f09d bugfix - timelapse image loader
multithreading.py - typing + docs
2022-08-25 12:38:05 +01:00
torzdf 2beceffad9 Data Augmentation update (#1263)
- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor
2022-08-21 18:59:45 +01:00
torzdf 3295089737 lib.detected_face.Mask
- Add source + target offset and coverage to set_sub_crop method
2022-08-19 10:57:40 +01:00
torzdf 42407e9d5c linting 2022-06-18 14:52:18 +01:00
torzdf 00544f432a Bugfix: Collect mask correctly in training and convert 2021-05-20 13:39:16 +01:00
torzdf 40798fd27f core mask updates:
- Add support for different mask centering
  - Update legacy alignments to store mask centering
  - Bugfix: lib.image ImageIO. Ensure unique queues are created (fixes mask tool when Face is input and an output folder is provided)
2021-05-16 13:24:00 +01:00
torzdf ecd17d4ba7 Bugfix: Training Generator - Output image name with NoneType errors 2021-05-14 11:59:00 +01:00
torzdf 3835f3959d bugfix: augmentation: Use np.any for truth value 2021-05-14 01:54:26 +01:00
torzdf add2d10315 Bugfix: Augmentation - Correctly calculate Clahe chance 2021-05-14 01:46:57 +01:00
torzdf 38d77f5583 bugfix: Training Generator - Catch Nonetypes when loading images 2021-05-14 00:29:27 +01:00
torzdf 3301c1ee29 Bugfix - Training - Fix eye/mouth multiplier for some models 2021-05-06 11:02:15 +00:00
torzdf 29beb7a23d bugfix - Fix race condition when WTL is selected 2021-05-05 16:40:20 +00:00
torzdf e0a98e9b69 Training bugfixes:
- lib.training.generator
      - Fix duplicate "legacy faceset" warning
      - Fix missing mask error message
  - gui: Fix bug in live stats when resuming an old session
2021-04-20 13:56:03 +01:00
torzdf 51b316ee6c lib.training.generator - Catch mismatched image sizes in training folder 2021-04-03 11:31:58 +01:00