184 Commits

Author SHA1 Message Date
torzdf 7aa85b29aa extract bugfixes: vgg-obstructed model path + unet-dfl output shape 2026-05-21 12:02:26 +01:00
torzdf 815b11f104 Migrate optimizers to torch (#1547) 2026-05-21 08:44:57 +01:00
torzdf fc1dcd1fd0 bugfix: Loss function device allocation 2026-04-24 10:24:24 +01:00
torzdf ed70efdf3f hrnet: Slightly improved weights 2026-04-20 10:09:13 +01:00
torzdf 7203cf3dea bugfix: Align - Fix re-feed OOB cropping + loosen HRNet BBox 2026-04-05 19:14:34 +01:00
torzdf d21781264d Extraction Overhaul (#1533)
* Extract refactor
2026-03-20 23:52:37 +00:00
torzdf 342e19d56e bugfix: Mask tool for bisenet-fp 2026-01-05 12:29:50 +00:00
torzdf 81b6002c35 Bugfixes:
- Convert: Fix error when 'learn mask' has been selected
  - Bisenet-FP mask: Correctly store mask for face or head centering
2025-12-31 14:24:16 +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 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 70c064ca7d Minor fixups and linting 2024-04-03 15:14:32 +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 97a842112c lib.align.aligned_face - Add split_mask method 2024-04-03 13:57:19 +01:00
torzdf 1d3c59c351 Bugfix: Extract error on rotate faces 2024-03-20 15:24:30 +00:00
torzdf b870c7d9bb typofix 2023-06-28 19:17:43 +01:00
torzdf 467ff6bf20 bugfix: Handle dtype change for cv2-dnn aligner 2023-06-28 19:16:03 +01:00
torzdf 99fd844bb3 bugfix: plugins.aligner - predict dtype 2023-06-28 18:54:59 +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 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 ac8206ed6e bugfix: Extract - rotation in detection 2023-06-15 18:28:37 +01:00
torzdf 02239d4183 locales: Train settings 2023-06-11 23:30:05 +01:00
torzdf a66214c58e locales: Add global extract settings 2023-06-08 16:45:18 +01: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 8a5ee6d9bf Bugfix: Patch extract memory leak in batch mode 2023-02-10 15:52:34 +00:00
torzdf 28cb2fcffb Unhide options for ROCm 2023-01-11 14:34:30 +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 2faef58c5f Bugfix - Extract - re-align with identity filtering enabled 2022-11-22 17:34:44 +00:00
torzdf 9e2026f6fe Extract: Implement re-align/2nd pass
- implement configurable re-align function in extract
  - update locales + documentation
  - re-factor align._base and split to separate modules
  - move normalization method to plugin parent
  - bugfix: FAN use zeros for pre-processing crop
  - lint AlignedFilter
2022-11-22 00:37:29 +00:00
torzdf 113b7d7db4 Aligner filters bugfixes
- Skip roll check if disabled
  - Correct subfolder name for features check
2022-11-09 12:56:23 +00:00
torzdf c698f45a35 Aligner - Add feature position filter 2022-11-08 17:09:43 +00:00
torzdf cb8ec69789 Aligner updates
- Add filter re-feeds option
  - bugfix roll calculation
2022-11-08 12:10:56 +00:00
torzdf 0f5d2e887c Face-filter updates:
- Allow selecting folder as well as multiple images
  - Lower default threshold and update helptext
  - bugfix: detector error when using all aligned faces
  - Standardize output folder name
2022-11-04 18:43:55 +00:00
torzdf 1d1face00d Update Face Filter
- Remove old face filter
  - plugins.extract.pipeline: Expose plugins directly
  - Change `is_aligned` from plugin level to ExtractMedia level
  - Allow extract pipeline to take faceswap aligned images
  - Add ability for recognition plugins to accept aligned faces as input
  - Add face filter to recognition plugin
  - Move extractor pipeline IO ops to own class
2022-10-31 18:25:32 +00:00
torzdf f1e3339fbe Add vggface2 to extraction pipeline 2022-10-10 13:09:02 +01:00
torzdf 1f31af233e bugfix: Aligner size filter to int64 2022-10-04 12:13:26 +01:00
torzdf 765e385177 Extract: Typing and standardization 2022-09-30 18:36:35 +01:00
torzdf 376c419498 Bugfix: Manual tool. Explicitly disable aligner filters 2022-09-24 01:09:41 +01:00
torzdf fba2e6e851 Bugfix: Alignments tool sorting error in 'from-faces' 2022-09-23 19:48:48 +01:00
torzdf 8776e21629 Extract: Add roll filter to aligner filters 2022-09-23 14:25:21 +01:00
torzdf 50d23792ca Aligner filter - set sensible defaults 2022-09-21 01:04:33 +01:00
torzdf f5fa5b4337 Extract filter: Allow saving of filtered images 2022-09-19 00:13:41 +01:00
torzdf 5ba07eaa58 bugfix: Extract - don't put empty batches through aligner 2022-09-18 20:44:01 +01:00
torzdf a8f22cc019 Extract updates:
- Default CPU detector to MTCNN
  - add basic Aligner false positive filters
  - Typing: align + plugins
  - Use specific AlignerBatch class for alignment
  -
2022-09-18 19:44:41 +01:00
torzdf 2d312a9db2 Minor updates and fixups
- Mask Tool - Typing + BiSeNet mask update fix
  - Alignments Tool - Auto search for alignments file
2022-09-14 19:14:03 +01:00
torzdf 98d01760e4 Overhaul sort:
- Standardize image data reading and writing
  - Optimize loading (just one pass required)
  - Make all sort groups binnable (to greater or lesser results)
  - Add sort by pitch
  - Deprecate multiple options
  - linting, docs + locales
2022-09-13 13:08:59 +01:00
torzdf 13cfb3f39e extract: Add batch processing mode 2022-08-31 19:48:47 +01:00
torzdf 1022651eb8 Bugfix: convert - Gif Writer
- Fix non-launch error on Gif Writer
  - convert plugins - linting
  - convert/fs_media/preview/queue_manager - typing
  - Change convert items from dict to Dataclass
2022-08-26 23:56:03 +01:00
torzdf 5e73437be4 lib.align updates:
- alignments.py
    - Add typed dicts for imported alignments
    - Explicitly check for presence of thumb value in alignments dict
    - linting
  - detected_face.py
    - Typing
    - Linting
    - Legacy support for pre-aligned face
    - Update dependencies to new property names
2022-08-19 12:36:08 +01:00
torzdf 26dde3c19a Add CPU option to BiSeNet and MTCNN
- Add CPU option to KSession
  - MTCNN optimizations
  - Update docs for bisenet + mtcnn
2022-08-08 14:29:32 +01:00