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

55 commits

Author SHA1 Message Date
torzdf
4a68b3f023 Move custom dlight blocks to nn_blocks 2020-06-07 17:06:00 +00:00
torzdf
ac40b0f52f
Remove subpixel upscaling option (#1024) 2020-05-13 13:50:48 +01:00
torzdf
815c843f63
Simple backend unit tests (#1020)
* Add simple backend tests for lib.model
* Document lib.model
* Fix GMSD Loss for AMD
* Remove obsolete code from lib.model
2020-05-12 23:46:04 +01:00
torzdf
88f9092a10 AMD: Fix ICNR Initialization for PlaidML backend 2020-05-06 15:28:56 +00:00
torzdf
1bdc9da02f
Smart Masks to Convert (#957)
- scripts.convert - Use Smart Masks for Convert
    * Make on-the-fly conversion an explicit option

- Move BlurMask to lib.faces_detect

- tools.preview - Fix for smart masks
    * Subclass from tk.Tk
    * Options to lib.gui.control_helper
    *variable cleanup

- lib.logger - Demote more tensorflow deprecation messages

- Documentation:
    * lib.faces_detect.BlurMask
    * plugins.convert.mask
    * lib.convert
    * scripts.convert
    * scripts.fsmedia
    * tools.preview
2019-12-29 23:13:25 +00:00
kvrooman
47681a8bab Landmarks stored and used as floating point numbers (#928)
* remove and fix int adjustments
* masking rounding
2019-11-15 11:01:37 +00:00
kvrooman
b49c352e8f # pylint:disable=no-member cleanup (#927)
# pylint:disable=no-member cleanup
2019-11-13 12:17:59 +00:00
torzdf
6efafaba75 Merge branch 'master' into staging 2019-10-26 02:09:02 +01:00
torzdf
3d06ce99aa lib.nn_blocks bugfix for upscaler 2019-10-26 02:08:38 +01:00
torzdf
64d92fd595 Merge branch 'staging' into smart-mask-alpha 2019-10-15 22:23:46 +00:00
torzdf
803b6ce02f Catch Cuda Driver Insufficient error and raise with useful message 2019-10-15 22:21:45 +00:00
torzdf
3deb79392d Merge branch 'staging' into smart-mask-alpha 2019-10-12 09:41:19 +00:00
torzdf
468e2709de Mask plugin cleanup
- PEP8 Fixes
- Remove config for non NN Masks
- Tidy up defaults helptext
- cli.py fix typos
- Remove unused imports and functions _base.py
- Standardize input_size param
- Enable and update documentation
- Change references from `aligner` to `masker`
- Change  input_size, output_size and coverage_ratio from kwargs to params
- Move load_aligned to batch input iterator
- Remove unnecessary self.input param
- Add softmax layer append function to KSession
- Remove references to KSession protected objects
- Standardize plugin output into finalize method
- Make masks full frame and add to lib.faces_detect
- Add masks to alignments.json (temporary zipped base64 solution)
2019-10-11 18:17:39 +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
torzdf
091bed3646 nn_blocks: Update naming convention 2019-10-02 17:44:45 +01:00
torzdf
29a75b90d4 Extract: Expose "allow_growth" option 2019-09-29 12:06:04 +01:00
torzdf
7bdaa81cbe Optimize CAI 2019-09-29 00:14:15 +01:00
torzdf
84932c0a87 Bugfix: Don't overide kernel_initializer if it is explicitly set in model definition 2019-09-27 16:32:02 +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
torzdf
feb5f75201 set mtcnn Nvidia defaults 2019-09-18 22:30:49 +00:00
kilroythethird
b7cd51a2f1 Optimized mtcnn a bit + added batching (#874) 2019-09-18 23:09:00 +01:00
torzdf
88352b0268
De-Multiprocess Extract (#871)
* requirements.txt: - Pin opencv to 4.1.1 (fixes cv2-dnn error)

* lib.face_detect.DetectedFace: change LandmarksXY to landmarks_xy. Add left, right, top, bottom attributes

* lib.model.session: Session manager for loading models into different graphs (for Nvidia + CPU)

* plugins.extract._base: New parent class for all extract plugins

* plugins.extract.pipeline. Remove MultiProcessing. Dynamically limit batchsize for Nvidia cards. Remove loglevel input

* S3FD + FAN plugins. Standardise to Keras version for all backends

* Standardize all extract plugins to new threaded codebase

* Documentation. Start implementing Numpy style docstrings for Sphinx Documentation

* Remove s3fd_amd. Change convert OTF to expect DetectedFace object

* faces_detect - clean up and documentation

* Remove PoolProcess

* Migrate manual tool to new extract workflow

* Remove AMD specific extractor code from cli and plugins

* Sort tool to new extract workflow

* Remove multiprocessing from project

* Remove multiprocessing queues from QueueManager

* Remove multiprocessing support from logger

* Move face_filter to new extraction pipeline

* Alignments landmarksXY > landmarks_xy and legacy handling

* Intercept get_backend for sphinx doc build

# Add Sphinx documentation
2019-09-15 17:07:41 +01:00
Artem Ivanov
23bb80a9ad Nnblocks added scale factor to Upscaler (#869)
* Update nn_blocks.py
2019-09-14 11:58:53 +01: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
d5fe314e41 kernel_initializer bugfix 2019-08-06 18:07:56 +01:00
torzdf
0f62379bee Revert Res Block kernel initialization 2019-08-06 16:26:42 +00:00
torzdf
c159d36f8e Add Style Loss to losses 2019-08-03 12:13:50 +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
286f6b28b3 Bugfixes
- Fix filter/nfilter for convert
- Remove existing snapshot folder before creating if it pre-exists
- Don't initialize training session until after first save. "Nonetype" session fix
2019-07-29 16:53:04 +00:00
kilroythethird
7ceeabac87 Switch to keras version for sort face (#791)
Upgrade to vgg_face2 (keras) to speed up sort by face
2019-07-21 12:37:41 +01: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
0a82e51146 Bugflx: Correct input variable to res_block 2019-07-17 10:01:13 +00:00
torzdf
4371d503a1 Remove he_uniform from init from res block and use FS default 2019-07-16 17:05:22 +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
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
kilroythethird
8f76f7ab4d Removed functions now implemented in plaidml itself (#771) 2019-06-24 11:54:33 +01:00
torzdf
fdd26aa698 Bugfix: Extended Mask. Prevent shifted points from exploding and killing models. 2019-06-16 00:10:38 +00:00
torzdf
f117846c22 Extended Mask. Extends eyebrow points up the forehead 2019-06-12 11:05:48 +00:00
torzdf
26836a4907 Bugfixes
Facefilter - Variable reference before assignment
masks - Facehull initialize to 255.0 instead of 1.0
Alignments tool - Stop tool from ignoring upper case extensions
pep8 fixes
2019-05-31 17:48:53 +01: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
b6e26ae079 Linting 2019-04-09 19:46:49 +01:00
kilroythethird
27c8db43d1 plaidml support for dssim + reflective padding (#686) 2019-04-09 18:06:53 +01:00
kilroythethird
f1b7b12768 Guesswork patch to prevent tf 'can't sort' bug (#688) 2019-04-09 17:48:47 +01:00
torzdf
4ad877babc
Revert "replaced PenalizedLoss function with keras alternative (#665)" (#687)
This reverts commit c717a4b4ea.
2019-03-31 19:29:41 +01:00
khilos
cb4dd9ed25 Update nn_blocks.py
Fix Scale for GAN
2019-03-22 07:47:07 -05:00
kvrooman
e99fa49e48 Mask optimizations (#673)
* Mask optimizations

- Remove repetitive np.array() of items that are already np.arrays
- Remove repetitive reshaping
- Perform dilation on single channel only
- Clarify dfl_full mask parts
- Simplify with for loop
- Add more complex mask based on facial components
- Prep for convert masks

* Line width clarity

Line width clarity

* docstring

* style consistency

* flake8 fixes

* Update _config.py

descritions
2019-03-21 15:58:25 +00:00
kilroythethird
c717a4b4ea replaced PenalizedLoss function with keras alternative (#665)
* replaced PenalizedLoss function with keras alternative

* Don't rely on implicite broadcasting
2019-03-21 11:34:07 +00:00