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

58 commits

Author SHA1 Message Date
torzdf
ac40b0f52f
Remove subpixel upscaling option (#1024) 2020-05-13 13:50:48 +01:00
torzdf
8fee68e2b9 bugfix: plugins.train.model._base - Legacy update.
Set `learn_mask` to False on legacy models if a `mask_type` does not exist otherwise `True`
2019-12-19 23:41:32 +00:00
torzdf
c1e6080d92 Training: Cleaner loss printing 2019-12-12 13:27:14 +00:00
torzdf
43a4d06540
Smart Masks - Training Implementation (#914)
* Smart Masks - Training

- Reinstate smart mask training code
- Reinstate mask_type back to model.config
- change 'replicate_input_mask to 'learn_mask'
- Add learn mask option
- Add mask loading from alignments to plugins.train.trainer
- Add mask_blur and mask threshold options
- _base.py - Pass mask options through training_opts dict
- plugins.train.model - check for mask_type not None for learn_mask and penalized_mask_loss
- Limit alignments loading to just those faces that appear in the training folder
- Raise error if not all training images have an alignment, and alignment file is required
- lib.training_data - Mask generation code
- lib.faces_detect - cv2 dimension stripping bugfix
- Remove cv2 linting code

* Update mask helptext in cli.py

* Fix Warp to Landmarks
Remove SHA1 hashing from training data

* Update mask training config

* Capture missing masks at training init

* lib.image.read_image_batch - Return filenames with batch for ordering

* scripts.train - Documentation

* plugins.train.trainer - documentation

* Ensure backward compatibility.
Fix convert for new predicted masks

* Update removed masks to components for legacy models.
2019-12-05 16:02:01 +00:00
torzdf
70ee125283 Serialize masks to alignments file
- Add new serializers (npy + compressed)
- Remove Serializer option from cli
- Revert get_aligned call in scripts/extract
- Default alignments to compressed
- Size masks to 128px and compress
- Remove mask thresholding/blur from generation code
- Add Mask class to lib/faces_detect
- Revert debug landmarks to aligned face
- Revert non-extraction code to staging version
2019-10-13 22:50:28 +00:00
torzdf
3deb79392d Merge branch 'staging' into smart-mask-alpha 2019-10-12 09:41:19 +00:00
torzdf
e35918cadf
Standardize serialization (#903)
* Standardize serialization

- Linting
- Standardize serializer use throughout code
- Extend serializer to load and save files
- Always load and save in utf-8
- Create documentation
2019-10-10 23:11:12 +01:00
kvrooman
995a857154 Smart Mask Exposure for Extraction & Training (#831)
Smart Masks - Initial Commit
2019-10-07 16:16:18 +01:00
torzdf
c63b080937 Add non-fixed items to session item in state.json 2019-10-04 10:35:05 +00:00
torzdf
174e6950ea Logging format fixes 2019-09-25 13:01:24 +01:00
torzdf
66ed005ef3
Optimize Data Augmentation (#881)
* Move image utils to lib.image
* Add .pylintrc file
* Remove some cv2 pylint ignores
* TrainingData: Load images from disk in batches
* TrainingData: get_landmarks to batch
* TrainingData: transform and flip to batches
* TrainingData: Optimize color augmentation
* TrainingData: Optimize target and random_warp
* TrainingData - Convert _get_closest_match for batching
* TrainingData: Warp To Landmarks optimized
* Save models to threadpoolexecutor
* Move stack_images, Rename ImageManipulation. ImageAugmentation Docstrings
* Masks: Set dtype and threshold for lib.masks based on input face
* Docstrings and Documentation
2019-09-24 12:16:05 +01:00
Kyle
9a57af45d5 loss name correction 2019-09-22 16:37:43 -05:00
torzdf
1cb67c585e Move gaussian_blur to losses (fixes plaidml race condition) 2019-08-08 00:43:44 +01:00
torzdf
f7ecae2997 Add "mask_blur" option for training 2019-08-08 00:09:30 +01:00
torzdf
40f8ac8768 Fix penalized loss for multiscale decoders 2019-08-07 13:46:36 +00:00
torzdf
af41940c94 Merge branch 'master' into staging 2019-08-04 13:23:38 +00:00
torzdf
ee2e081446 Disable VRAM saving features for plaidML users
- Disable non-compatible vram saving features for plaidML users
- Move VRAMSavings to own class in /model/_base.py
2019-08-04 13:22:30 +00:00
torzdf
111d275078 Post PR Fixups
- train/_config.py: PEP8 Fixes. Slight description change on coverage
- models/_base.py:
   - Remove unused variables from Loss()
   - Delete legacy config items from state file
   - Save state file on Legacy update
   - PEP8
- Remove _defaults.py for models with no config options
2019-08-03 12:09:13 +00:00
kvrooman
b7b1bd5c6f documentation, pep8, style, clarity updates - Prep for Segmentation (#812)
* documentation, pep8, style, clarity updates

* Update cli.py

* Update _config.py

remove extra mask and coverage

mask type as dropdown

* Update training_data.py

move coverage / LR to global
cut down on loss description

style change
losses working in PR

* simpler logging

* legacy update
2019-08-03 12:38:43 +01:00
torzdf
a1462c98bc Bugfix: Correctly name models on reload 2019-08-02 09:24:49 +00:00
torzdf
7d613cfbb3 bugfix: Make sure stored input shapes are json serializable 2019-07-24 18:20:06 +00:00
torzdf
5c17417d4d Training: Add Multi-Output Support
- Name output nodes of models
- Add support for multiple outputs in models and in training
- Update loss output format for cli and gui
- Sort graphs tabs on training
- Fix analysis graph for new loss names
- Multi output support in convert
2019-07-24 12:32:21 +00:00
torzdf
40103b9c4a Model Structure Changes
Standardize inputs for AutoEncoders
Name outputs from AutoEncoders
Name layers in nn_blocks.py
2019-07-18 17:04:47 +00:00
torzdf
5418fba726
Add Convolutional Aware Initialization (#795)
* Training: Add Convolutional Aware Initialization config option

* Centralize Conv2D layer for handling initializer

* Add 'is-output' to NNMeta to indicate that network is an output to the Model
2019-07-16 10:09:29 +01:00
torzdf
03d419c505 Training improvements
Add Optimizer Savings option to offload some optimizer calculations to the CPU
Add output_shape to NNMeta class for referencing when building models
2019-07-10 22:35:41 +00:00
torzdf
79ece7af2b bugfix: Train Posix Path to String 2019-07-08 22:17:21 +00:00
torzdf
ce45f01e4a Error Handling
Preview Tool: Catch no faces found Error
Training: Raise unhandled ValueErrors
2019-07-08 11:28:44 +00:00
torzdf
541498970e Training Fixups
Only show model folder deprecation warning for existing models
Gracefully exit FixedProducerDispatcher on error
2019-07-07 12:23:01 +00:00
torzdf
ae74e80483 Deprecation Warnings, Error Handling and Bugfix
Deprecation Warning: Rotation in Extract
Deprecation Warning: Multiple models within a single folder
Error Handling: Useful message for training size assertion error
Error Handling: Useful message for fewer images than batch size
Bugfix: BoundingBox object sometimes not available inside spawned process
2019-07-05 10:28:56 +00:00
torzdf
e1fca14716 Add Restore Model Tool
Tool: Add tool to restore models from backup
Snapshot: Create snapshot based on total iterations rather than session iterations
Models: Move backup/snapshot functions to lib/model
Training: Output average loss since last save at each save iteration
GUI: display_page.py: minor logging update
2019-07-01 23:28:31 +00:00
torzdf
be98d0147f Fix typo 2019-06-30 23:49:56 +01:00
torzdf
d151722487 Handle corrupted model error 2019-06-30 16:04:16 +00:00
torzdf
0e76422805 Expose Augmentation Options to config 2019-06-26 10:48:38 +00:00
torzdf
0db645ae41 Explicit string in snapshot_models 2019-06-26 01:31:48 +01:00
torzdf
88fbd433a8 Fixups
- Training: Replace -ac (augment-color) option with -nac (no-augment-color) option (color augmentation on by default)
    - Analysis: Correctly display currently loaded session
    - Analysis: Cursor events in graph popup
2019-06-25 23:46:39 +00:00
torzdf
5917cc40b1 Allow customization of number of preview images to display 2019-06-16 13:55:27 +01:00
torzdf
71bcd863e1 Bugfixes and minor changes
Fix: Occasional memory leak in convert
Fix: Dynamic config loading in Windows
Change: Better folder naming for snapshots
2019-06-11 17:26:43 +00:00
torzdf
0eff0a1719 Config Changes + Bugfixes
Bugfix: Fully disable keypress monitor for GUI
Bugfix: Preview - Handle missing alignments file
Config changes:
    - Separate plugin defaults into their own files
    - Move mask_type to global training config
    - Add ability to pass in custom config files
2019-06-11 01:13:42 +00:00
torzdf
0da3b5ef82
Color Augmentation method (#752)
* Color Augmentation: Implement testing code

* Tweak Contrast and Lighting augmentation amounts

* Prevent color augmentation from entering timelapse

* Remove all augmentations from preview images
2019-06-08 11:52:17 +01:00
torzdf
a5d1d60992 Minor changes
Convert - Force prediction batchsize to 1 when converting on CPU
Training: Move snapshot saving to outside of the save threads to avoid race condition
GUI Summary stats. Show iteration count for current training session (fixed to last save amount).
2019-06-04 12:43:49 +01:00
torzdf
2071c6df45 Add save snapshot backup option for training 2019-06-03 01:43:35 +00:00
torzdf
27a685383e
Convert refactor (#703)
* Separate predict and implement pool

* Add check and raise error to multithreading

Box functions to config. Add crop box option.

* All masks to mask module. Refactor convert masks

Predicted mask passed from model. Cli update

* Intesect box with mask and fixes

* Use raw NN output for convert

Use raw mask for face adjustments. Split adjustments to pre and post warp

* Separate out adjustments. Add unmask sharpen

* Set sensible defaults. Pre PR Testing

* Fix queue sizes. Move masked.py to lib

* Fix Skip Frames. Fix GUI Config popup

* Sensible queue limits. Add a less resource intensive single processing mode

* Fix predicted mask. Amend smooth box defaults

* Deterministic ordering for video output

* Video to Video convert implemented

* Fixups

- Remove defaults from folders across all stages
- Move match-hist and aca into color adjustments selectable
- Handle crashes properly for pooled processes
- Fix output directory does not exist error when creating a new output folder
- Force output to frames if input is not a video

* Add Color Transfer adjustment method

Wrap info text in GUI plugin configure popup

* Refactor image adjustments. Easier to create plugins

Start implementing config options for video encoding

* Add video encoding config options

Allow video encoding for frames input (must pass in a reference video)
Move video and image output writers to plugins

* Image writers config options

Move scaling to cli
Move draw_transparent to images config
Add config options for cv2 writer
Add Pillow image writer

* Add gif filetype to Pillow. Fix draw transparent for Pillow

* Add Animated GIF writer

standardize opencv/pillow defaults

* [speedup] Pre-encode supported writers in the convert pool (opencv, pillow)

Move scaling to convert pool
Remove dfaker mask

* Fix default writer

* Bugfixes

* Better custom argparse formatting
2019-04-21 19:19:06 +00:00
torzdf
99ac2f687b Allow 'unfixed' parameters for model config 2019-04-10 11:42:42 +01:00
torzdf
cdc6f4250f Merge branch 'master' into staging 2019-03-25 10:23:03 +00:00
torzdf
88dffe0854 Fix losses bug 2019-03-25 10:22:45 +00:00
kilroythethird
98ecfca84b simplify shape test in model (#672) 2019-03-21 11:41:30 +00:00
torzdf
304fa68dc3 Correct dfaker config.
Make lr configurable
2019-03-18 00:24:36 +00:00
torzdf
dba7d4162d
VRAM Improvement Options (#671)
* Implement ping-pong training

* Disable tensorboard for pingpong training

* Implement Memory Saving Gradients
2019-03-17 09:25:39 +00:00
torzdf
2bc9826ad7 Add clipnorm back in as optimizer option for unbalanced 2019-03-07 18:05:34 +00:00
torzdf
b9f99c5797 bugfix: Don't clear session when loading legacy weights 2019-03-04 00:29:21 +00:00