65 Commits

Author SHA1 Message Date
torzdf 815b11f104 Migrate optimizers to torch (#1547) 2026-05-21 08:44:57 +01:00
torzdf 83fdd5f938 Train: Migrate data loading to Torch (#1540) 2026-04-16 19:19:53 +01:00
torzdf aa066ad7b2 bugfix: Aligned faces. Fix padding calculation 2026-04-08 10:02:06 +01:00
torzdf f403afbfa2 bugfix: legacy alignments conversion 2026-04-08 07:21:32 +01:00
torzdf 30d087acb9 bugfix: alignments datadict: Allow loading missing identities and masks 2026-04-08 07:16:37 +01:00
torzdf 604374100e bugfix: Aligned face - fix sub-crops + landmark mask mapping for coverage != 1.0 and y-offset != 0.0 2026-04-08 00:42:08 +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 6ae823141c bugfix: vertical-offset in convert and preview 2026-03-27 15:11:05 +00:00
torzdf 7c0665fffa Replace imageio with pyav/ffmpeg-binaries (#1534) 2026-03-24 17:25:12 +00:00
torzdf d21781264d Extraction Overhaul (#1533)
* Extract refactor
2026-03-20 23:52:37 +00:00
torzdf dd2323bc70 Backported updates:
- Docs: Centralize sphinx requirements
- Logging: Handle Torch warnings and logging within our logging module
- Logging: More robust array logging handling
- Alignments: Store arrays as list in alignments file
- Alignments: Minor constants + Pose updates
- Add insightface_resnet network
- Update requirements
2026-03-12 10:27:16 +00:00
torzdf aa40efabf3 Backported code to support future updates 2026-02-27 19:30:27 +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 3f53ee9cec Bugfix: Convert - Correctly error if a valid mask has not been selected 2024-08-02 18:35:34 +01:00
torzdf 1f4fcff5dd bugfix: Alignments, prevent duplicate backup alignment file names 2024-05-19 11:04:48 +01:00
torzdf 13dd5b3a90 bugfix: Alignments - correctly update keys for multiple underscores in the filename 2024-04-26 17:39:46 +01:00
torzdf 0f947791f5 bugfix: Alignments remove version check for video file extension update
- Typofixes
2024-04-21 20:03:42 +01:00
torzdf be42b04064 Bugfix: Alignment file video key lookup for very old alignment files 2024-04-21 19:55:45 +01:00
torzdf dce7d98302 lib.align: Split lib.align.alignments to smaller modules:
- Move update objects to own module
  - Move Thumbnails to own module
  - docs update + linting/typing
2024-04-19 13:45:30 +01:00
torzdf 96528ee3e8 lib.align.detected_face: Split Mask objects to own aligned_mask module 2024-04-19 12:25:00 +01:00
torzdf 957734dfc0 convert: Bugfix: Update legacy .png video alignments to include video file extension 2024-04-17 12:37:47 +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 97a842112c lib.align.aligned_face - Add split_mask method 2024-04-03 13:57:19 +01:00
torzdf 4502824481 Add mask dilation/erosion option for training 2024-03-26 18:06:48 +00:00
torzdf 7a16f753cc Add Mask importing to the mask tool (#1376)
* lib.align.alignments: expose count_faces_in_frame
* tools.mask: refactor and fix frame output to display all masks in a single frame
* tools.mask: add import mask process
* manual tool: Remove NN masks on landmark edit
2024-03-12 13:17:35 +00:00
torzdf 4588adbd16 remove debug code 2023-09-01 19:44:57 +01:00
torzdf 460a229e79 bugfix: edge case NaN in pose estimation 2023-09-01 19:43:05 +01:00
torzdf efa4471243 typing:
- tools.manual.detected_faces
  - tools.manual.thumbnails
2023-06-28 18:30:17 +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 c698f45a35 Aligner - Add feature position filter 2022-11-08 17:09:43 +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 765e385177 Extract: Typing and standardization 2022-09-30 18:36:35 +01:00
torzdf c79175cbde Alignments Tool updates
- Copy info back to alignments file from faces
2022-09-26 19:32:09 +01:00
torzdf e5356a417e Alignments update:
- Store face embeddings in PNG header when sorting
  - typing + refactor
  - Update alignments keys for 'identity' and 'video_meta' + bump to v2.3
  - General typing fixes
2022-09-25 18:22:48 +01:00
torzdf a7d0898f64 sort tool: Add sort by roll 2022-09-23 14:18:48 +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 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 9e503bdaa2 bugfix: debug landmarks 2022-08-23 19:19:16 +01:00
torzdf 66845ea5f0 bugfix: Alignments - Thumbnail generation check 2022-08-22 10:41:33 +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 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 a2de4a9798 lib.align.aligned_face updates
- Typing
  - Legacy support for pre-aligned faces
  - Coverage support for pre-aligned faces
  - Standardized retrieval of sub-crops
2022-08-19 11:53:46 +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 c2595c46d4 bugfix - add missing mask key to alignments on legacy update 2022-05-20 17:06:25 +00:00
torzdf ac22d40a91 extract: mask - Delete any mask from outside of frame boundaries 2021-07-22 13:04:29 +01:00
torzdf eb96da0346 Add Misalignment Detection
- lib.align.AlignedFace - Add average_distance property (distance from mean_face)
  - tools.manual - Add misaligned Faces filter
  - tools.sort - Add sort by distance (misaligned sort)Add "Misaligned Faces" filter to manual tool
2021-06-08 19:30:28 +01:00