Commit Graph

310 Commits

Author SHA1 Message Date
torzdf
5f598ca825 Locales Update 2021-03-22 18:41:55 +00:00
torzdf
a49f810e7c GUI - Make tooltips themeable 2021-03-20 14:08:07 +00:00
torzdf
544a95bc4f linting 2021-03-19 01:09:52 +00:00
Dominik Miszkiewicz
86ac596784
Update sorting by yaws (#1131) 2021-03-19 01:06:26 +00:00
torzdf
a656552204 Minor Updates
- GUI - Tweaks
    - Fix Analysis Slider background color
    - More granular theming controls
    - Standardize comboboxes and scrollbars
  - plugins.train.model._base
      - Catch more model corruption errors
2021-03-18 17:43:56 +00:00
torzdf
cff0f5698b GUI updates
- Control panel fixes
  - Basic themeing support
  - Fix tools to display more natively
  - Give all config items a group
2021-03-16 19:46:14 +00:00
torzdf
073438fbcc GUI fixup - Add alignments tool job to processing group 2021-03-14 18:18:43 +00:00
torzdf
ea1f997850 Translations - Create .pot files for GUI Tooltips and tools 2021-03-10 17:04:58 +00:00
torzdf
790a094d34 Code updates:
- lib.image.update_existing_meta: optimize
  - plugins.tran.model._base - Capture corrupt model errors
2021-02-26 10:29:11 +00:00
torzdf
0401dd15a5 tools.alignments - Update png header when removing faces 2021-02-23 19:23:11 +00:00
torzdf
1f3e1b0656 Add Locale support for cli arguments 2021-02-18 23:53:01 +00:00
torzdf
b1cfbe458c
Update extracted faces to use PNG EXIF data (#1123)
Documentation
  - Update Usage.md, align.rst and image.rst
lib.image.py
  - read_image - Remove hash return, add metadata return
  - Remove read_image_hash functions
  - Add read_image_meta functios
  - Replace encode_image_with_hash with encode_image (to store metadata)
  - Add png meta reading and writing functions
  - Update Image Loaders/Savers to handle metadata rather than hashes
lib.training_data
  - Naming updates to remove references to hashes
lib.align.Alignments
  - Add versioning notes
  - Increment alignments version to 2.1
  - Deprecate hashing lookup functions
  - Replace filter_hashes with filter_faces
lib.align.detected_face
  - DetectedFace
    - Remove hash property
    - Add png header data serializing/deserializing functions
  - Mask
    - Add png header data serializing/deserializing functions
  - add update_legacy_png_header function to update png meta data
lib.cli.args - Deprecate alignments files for training
- plugins.train.trainer
  - Update alignments/mask code to read png header data
- scripts.convert
  - Aligned images folder - read data from png headers
- scripts.extract
  - Write png header information and no longer store hash of face
- tools.alignments
  - remove leftover-faces, merge and update-hashes jobs
  - Update jobs to use png meta data rather than hashes
- tools.manual
  - Update extract code to output png meta data and don't store hashes
  - Perform check on launch that tool is not pointing at a faces folder
tools.mask
  - Update to use png meta data
tools.sort
  - Update to use png meta data
2021-02-14 16:49:55 +00:00
torzdf
57b29b03cd preview tool: bugfix ttk.PanedWindow 2021-02-08 01:01:54 +00:00
torzdf
7d44aab33c Minor GUI Updates
- Switch paned window class to ttk
  - Properly pad StatusBar
2021-02-07 02:06:31 +00:00
torzdf
cd24f25f9a Extract - Always output faces as .png 2021-02-05 12:03:06 +00:00
torzdf
399df9860f jobs.alignments - fix memory leak on sparse alignments extract 2020-12-18 23:40:06 +00:00
torzdf
d392dfbdf7 Bugfixes
- Manual Tool:
    - Hide annotations for faces not meeting criteria
    - Update landmarks on face add/del
    - Clearer landmark annotations
    - Handle non-numerics in frame number box
  - Training
    - Fix mis-aligned preview images
    - Allows mixing legacy + new alignments for A and B
    - Catch non-training images in training folder
    - Catch inconsistently sized training images
    - Standardize coverage ratio calculation
    - lib.image - Add option to get image shape along with hash
Dfaker model:
  - Add 256px mode
2020-12-15 12:11:26 +00:00
torzdf
05018f6119
Extract - Increase area and move centering (#1095)
* Extract
  - Implement aligner re-feeding
  - Add extract type to pipeline.ExtractMedia
  - Add pose annotation to debug
* Convert
  - implement centering
  - remove usage of feed and reference face properties
  - Remove distributed option from convert
  - Force update of alignments file on legacy receive
* Train
  - Resize preview image to model output size
  - Force legacy centering if centering does not exist in model's state file
  - Enable training on legacy face sets

* Alignments Tool
  - Update draw to include head/pose
  - Remove DFL drop + linting
  - Remove remove-frames job
  - remove align-eyes option
  - Update legacy masks to new extract type
  - Exit if attempting to merge version 1.0 alignments files with version 2.0 alignments files
  - Re-generate thumbnails on legacy upgrade
* Mask Tool
  - Update for new extract + bugfix full frame
* Manual Tool
  - Update to new extraction method
   - Disable legacy alignments,
   - extract box bugfix
   - extract faces - size to 512 and center on head
* Preview Tool
  - Display based on model centering
* Sort Tool
  - Use alignments for sort by face

* lib.aligner
  - Add Pose Class
  - Add AlignedFace Class
  - center _MEAN_FACE on x
  - Add meta information with versioning to alignments file
  - lib.aligner.get_align_matrix to use landmarks not face
  - Refactor aligned faces in lib.faces_detect
* lib.logger
  - larger file log padding
* lib.config
  - Fix global changeable_items
* lib.face_filter
  - Use new extracted face images
* lib.image
  - bump thumbnail default size to 96px
2020-12-08 01:31:56 +00:00
torzdf
3dbbac5a98 Convert - Move scaling option exclusively to config 2020-10-20 14:36:43 +01:00
torzdf
a9d6d4efc8 Bugfix: Alignments Tool - Catch incorrect input type for leftover faces 2020-10-19 19:00:34 +01:00
torzdf
538a03d529 Bugfix: Tools to use updated lib.gui.utils.config 2020-09-24 16:30:01 +01:00
torzdf
a2f1cb46b9 Bugfix: Preview Tool. Fix blank swapped faces issue 2020-09-06 14:34:20 +01:00
torzdf
d8557c1970
Faceswap 2.0 (#1045)
* Core Updates
    - Remove lib.utils.keras_backend_quiet and replace with get_backend() where relevant
    - Document lib.gpu_stats and lib.sys_info
    - Remove call to GPUStats.is_plaidml from convert and replace with get_backend()
    - lib.gui.menu - typofix

* Update Dependencies
Bump Tensorflow Version Check

* Port extraction to tf2

* Add custom import finder for loading Keras or tf.keras depending on backend

* Add `tensorflow` to KerasFinder search path

* Basic TF2 training running

* model.initializers - docstring fix

* Fix and pass tests for tf2

* Replace Keras backend tests with faceswap backend tests

* Initial optimizers update

* Monkey patch tf.keras optimizer

* Remove custom Adam Optimizers and Memory Saving Gradients

* Remove multi-gpu option. Add Distribution to cli

* plugins.train.model._base: Add Mirror, Central and Default distribution strategies

* Update tensorboard kwargs for tf2

* Penalized Loss - Fix for TF2 and AMD

* Fix syntax for tf2.1

* requirements typo fix

* Explicit None for clipnorm if using a distribution strategy

* Fix penalized loss for distribution strategies

* Update Dlight

* typo fix

* Pin to TF2.2

* setup.py - Install tensorflow from pip if not available in Conda

* Add reduction options and set default for mirrored distribution strategy

* Explicitly use default strategy rather than nullcontext

* lib.model.backup_restore documentation

* Remove mirrored strategy reduction method and default based on OS

* Initial restructure - training

* Remove PingPong
Start model.base refactor

* Model saving and resuming enabled

* More tidying up of model.base

* Enable backup and snapshotting

* Re-enable state file
Remove loss names from state file
Fix print loss function
Set snapshot iterations correctly

* Revert original model to Keras Model structure rather than custom layer
Output full model and sub model summary
Change NNBlocks to callables rather than custom keras layers

* Apply custom Conv2D layer

* Finalize NNBlock restructure
Update Dfaker blocks

* Fix reloading model under a different distribution strategy

* Pass command line arguments through to trainer

* Remove training_opts from model and reference params directly

* Tidy up model __init__

* Re-enable tensorboard logging
Suppress "Model Not Compiled" warning

* Fix timelapse

* lib.model.nnblocks - Bugfix residual block
Port dfaker
bugfix original

* dfl-h128 ported

* DFL SAE ported

* IAE Ported

* dlight ported

* port lightweight

* realface ported

* unbalanced ported

* villain ported

* lib.cli.args - Update Batchsize + move allow_growth to config

* Remove output shape definition
Get image sizes per side rather than globally

* Strip mask input from encoder

* Fix learn mask and output learned mask to preview

* Trigger Allow Growth prior to setting strategy

* Fix GUI Graphing

* GUI - Display batchsize correctly + fix training graphs

* Fix penalized loss

* Enable mixed precision training

* Update analysis displayed batch to match input

* Penalized Loss - Multi-GPU Fix

* Fix all losses for TF2

* Fix Reflect Padding

* Allow different input size for each side of the model

* Fix conv-aware initialization on reload

* Switch allow_growth order

* Move mixed_precision to cli

* Remove distrubution strategies

* Compile penalized loss sub-function into LossContainer

* Bump default save interval to 250
Generate preview on first iteration but don't save
Fix iterations to start at 1 instead of 0
Remove training deprecation warnings
Bump some scripts.train loglevels

* Add ability to refresh preview on demand on pop-up window

* Enable refresh of training preview from GUI

* Fix Convert
Debug logging in Initializers

* Fix Preview Tool

* Update Legacy TF1 weights to TF2
Catch stats error on loading stats with missing logs

* lib.gui.popup_configure - Make more responsive + document

* Multiple Outputs supported in trainer
Original Model - Mask output bugfix

* Make universal inference model for convert
Remove scaling from penalized mask loss (now handled at input to y_true)

* Fix inference model to work properly with all models

* Fix multi-scale output for convert

* Fix clipnorm issue with distribution strategies
Edit error message on OOM

* Update plaidml losses

* Add missing file

* Disable gmsd loss for plaidnl

* PlaidML - Basic training working

* clipnorm rewriting for mixed-precision

* Inference model creation bugfixes

* Remove debug code

* Bugfix: Default clipnorm to 1.0

* Remove all mask inputs from training code

* Remove mask inputs from convert

* GUI - Analysis Tab - Docstrings

* Fix rate in totals row

* lib.gui - Only update display pages if they have focus

* Save the model on first iteration

* plaidml - Fix SSIM loss with penalized loss

* tools.alignments - Remove manual and fix jobs

* GUI - Remove case formatting on help text

* gui MultiSelect custom widget - Set default values on init

* vgg_face2 - Move to plugins.extract.recognition and use plugins._base base class
cli - Add global GPU Exclude Option
tools.sort - Use global GPU Exlude option for backend
lib.model.session - Exclude all GPUs when running in CPU mode
lib.cli.launcher - Set backend to CPU mode when all GPUs excluded

* Cascade excluded devices to GPU Stats

* Explicit GPU selection for Train and Convert

* Reduce Tensorflow Min GPU Multiprocessor Count to 4

* remove compat.v1 code from extract

* Force TF to skip mixed precision compatibility check if GPUs have been filtered

* Add notes to config for non-working AMD losses

* Rasie error if forcing extract to CPU mode

* Fix loading of legace dfl-sae weights + dfl-sae typo fix

* Remove unused requirements
Update sphinx requirements
Fix broken rst file locations

* docs: lib.gui.display

* clipnorm amd condition check

* documentation - gui.display_analysis

* Documentation - gui.popup_configure

* Documentation - lib.logger

* Documentation - lib.model.initializers

* Documentation - lib.model.layers

* Documentation - lib.model.losses

* Documentation - lib.model.nn_blocks

* Documetation - lib.model.normalization

* Documentation - lib.model.session

* Documentation - lib.plaidml_stats

* Documentation: lib.training_data

* Documentation: lib.utils

* Documentation: plugins.train.model._base

* GUI Stats: prevent stats from using GPU

* Documentation - Original Model

* Documentation: plugins.model.trainer._base

* linting

* unit tests: initializers + losses

* unit tests: nn_blocks

* bugfix - Exclude gpu devices in train, not include

* Enable Exclude-Gpus in Extract

* Enable exclude gpus in tools

* Disallow multiple plugin types in a single model folder

* Automatically add exclude_gpus argument in for cpu backends

* Cpu backend fixes

* Relax optimizer test threshold

* Default Train settings - Set mask to Extended

* Update Extractor cli help text
Update to Python 3.8

* Fix FAN to run on CPU

* lib.plaidml_tools - typofix

* Linux installer - check for curl

* linux installer - typo fix
2020-08-12 10:36:41 +01:00
torzdf
3fd26b51a6
Manual Tool (#1038)
Initial Commit
2020-07-25 11:05:29 +01:00
torzdf
30acca8541 Sort by face - Inherit allow_growth option from extract.ini 2020-07-04 10:38:46 +01:00
torzdf
ff8d85118e
Cli Restructure + Multi-Mask Select on Extract (#1012)
- Split up cli.py to smaller modules
- Enable Multi Mask Selection in Extraction
- Handle multi option selection options in the GUI
- Document lib/cli
2020-04-22 00:04:21 +01:00
torzdf
9461c59773 Bugfixes and minor updates:
- Remove preview option from effmpeg tool
  - Remove json filetypes from GUI for alignments files
  - Capture and raise empty timelapse folder errors
  - Move convert to use centralized ImagesLoader
2020-04-09 14:33:29 +01:00
torzdf
86a5921c8d Bugfix - Alignments Tool, DFL Conversion 2020-03-26 17:28:04 +00:00
torzdf
9fe4a65236 Bugfix: Mask Tool 2020-03-25 23:38:57 +00:00
torzdf
3d88630f4f
Core Update (#995)
* lib.alignments - Add Video Meta Data methods

* lib.image - Monkey Path ImageIO for video scanning
2020-03-23 13:15:21 +00:00
torzdf
4153a7ea0d
Tools Restructure (#990)
* Restructure tools to allow dynamic (plugable) loading

* Update gui cli parsing to allow new tools structure
2020-03-16 19:12:52 +00:00
torzdf
6e08c952f8 bug fix: tools.alignments. Set filename correctly when merging alignments 2020-03-04 15:09:39 +00:00
torzdf
2b5b871156
lib.alignments - Slight update (#978)
* lib.alignments update:
  - Minor structure change (faces to nested dictionary)
  - Refactor internal and external methods
  - Documentation
2020-03-02 17:13:32 +00:00
torzdf
f1b1535514 tools.alignments - Fix update hashes 2020-02-19 10:21:00 +00:00
torzdf
86d039c242 Convert - bugfixes
- Default mask to an available mask in Preview tool
- Correctly output predicted mask
2020-01-03 14:13:58 +00:00
torzdf
497779d293 lib.gui
Centralize get_scaling and set_geometry to utils.config
Suppress Error when rebuilding GUI for TreeView
2019-12-31 17:27:45 +00:00
torzdf
f2333e1f9d tools.preview - Limit mask selection to only masks available for all faces
plugins.mask - Correctly set dtype for "None" mask
2019-12-30 18:10:54 +00:00
torzdf
91da1bba8e tools.mask - Bugfixes
- Missing masks - fix memory leak
- Missing masks - Handle multiple faces in frames properly
2019-12-30 12:40:34 +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
torzdf
c721c22793 Merge branch 'staging' 2019-12-16 00:59:37 +00:00
torzdf
9ebc0abc8e tools.sort - Optimize sort by face 2019-12-16 00:59:00 +00:00
kvrooman
2e3e602559 bugfix: lib.tools.mask (#953) 2019-12-15 12:49:51 +00:00
torzdf
ef03be1706
Update Dependencies (#950)
* 1st Round update for Python 3.7, TF1.15, Keras2.3
    Move Tensorflow logging verbosity prior to first tensorflow import
    Keras Optimizers and nn_block update
    lib.logger - Change tf deprecation messages from WARNING to DEBUG
    Raise Tensorflow Max version check to 1.15
    Update requirements and conda check for python 3.7+
    Update install scripts, travis and documentation to Python 3.7

* Revert Keras to 2.2.4
2019-12-10 02:01:20 +00:00
torzdf
790b04a314 lib.alignments - Auto update legacy list landmarks to numpy array 2019-12-08 18:06:16 +00:00
torzdf
5a9565ca82 bugfix: lib.tools.alignments - Extract faces from frames as well as video 2019-12-08 16:52:35 +00:00
torzdf
ac1cf8fbe9 lib.alignments: improve re-extraction speed by 500% 2019-12-08 10:54:26 +00:00
torzdf
e2373fd872 Add job to fix frames where alignments are out by 1 2019-12-07 19:18:32 +00:00
torzdf
4ee9eac4f4 tools.alignments - Rewrite rename job to be more robust 2019-12-06 03:10:47 +00:00
torzdf
6f7ae98936 bugfix: tools..mask - Fix generation of new masks for face input 2019-12-05 20:13:22 +00:00
torzdf
c8c2601455 bugfix: tools.alignments - Fix DFL conversion 2019-12-05 12:50:00 +00:00
torzdf
e3f494aa41 bugfix: Mask Tool - To ExtractMedia object 2019-12-02 15:54:45 +00:00
torzdf
44b7461ca7 sort - remove unused variable 2019-11-30 00:32:25 +00:00
torzdf
8f5a7a6535 Bugfix: Sort by Yaw - Use Pipeline for landmarks 2019-11-30 00:17:19 +00:00
torzdf
4fdeb67fba Bugfix - Manual tool. Use new ExtractMedia class 2019-11-29 23:53:00 +00:00
torzdf
4591a02ee1 bugfix: tools.preview - Fix for new icons
bugfix: lib.vgg_face2_keras - Remove debug code
documentation: lib.vgg_face2_keras
2019-11-24 13:54:33 +00:00
torzdf
e481053bd0 bugfix: tools.preview - Load tooltip from custom_widgets 2019-11-24 00:21:44 +00:00
torzdf
83c28e7e9e bugfix tools.preview - Update icon names 2019-11-23 19:17:51 +00:00
torzdf
b55e499b0b bugfix: lib.gui + tools.preview - Update icon names 2019-11-23 19:15:06 +00:00
torzdf
9c588045aa
GUI Updates (#940)
* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats
2019-11-22 19:20:23 +00:00
kilroythethird
3ba917ce0d Added masking output support to tools->mask (#937) 2019-11-21 02:28:26 +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
2d229cee72 Color channel sorting (#905)
* Add Sort by Color Feature

Sort by
 - Grayscale
 - Luma
 - Green to Red
 - Orange to Blue
2019-11-14 12:54:29 +00:00
torzdf
73ff840fbd scripts.extract - code optimizations
Limit queue sizes to reduce RAM usage
Rename lib.image.BackgroundIO to ImageIO
Create separate ImagesLoader and ImagesSaver classes
Load/Save images from centralized lib.image.ImageIO
scripts.extract documentation
2019-11-13 19:16:25 +00:00
kvrooman
b49c352e8f # pylint:disable=no-member cleanup (#927)
# pylint:disable=no-member cleanup
2019-11-13 12:17:59 +00:00
kilroythethird
ffd3829930 Added allow_growth argument for preview 2019-11-07 04:28:04 +01:00
torzdf
09250eb51b Merge branch 'master' into staging 2019-11-02 23:23:13 +00:00
torzdf
b1dd0dbdc5 bugfix: lib.image - Ensure video frame count is always read correctly 2019-10-31 01:45:27 +00:00
torzdf
efbe606b0e Merge branch 'master' into staging 2019-10-29 11:38:53 +00:00
torzdf
8a721c7e7c masks: Ensure blur kernel is odd 2019-10-29 11:38:29 +00:00
torzdf
fb77f033c3 Bugfix: Manual Tool - Strip mask from adjusted faces 2019-10-28 17:08:32 +00:00
torzdf
3b2eaa591f Remove debug code 2019-10-28 10:47:25 +00:00
kvrooman
0e0b2faa1a ENHANCEMENT: Sort image multi-threading and code clarity (#912)
* Use multi-threaded loading

* fast reload

* remove landmark stub

* saves

* correct face sort

* pep8
2019-10-28 10:00:04 +00:00
kvrooman
650e00aa0a BUGFIX: recursive loading of images all sub-directories in sorter (#910)
* bugfix
2019-10-25 23:58:02 +01:00
torzdf
4edc25448f Mask tool
tools.mask - A tool for creating masks for existing alignments files and outputting mask previews
lib.image.BackgroundIO - A background image loader and saver
2019-10-25 18:08:20 +00:00
torzdf
6cda2176e2 lib.alignments - cache hashes_to_frame 2019-10-24 09:30:37 +00:00
torzdf
25a2ac95c3 Add faster image hash reading mechanism
Add batch hash reader to lib.images
Utilize batch hash reader in tools.alignments
2019-10-21 23:10:26 +00:00
torzdf
d93e7b1114 Smart Mask - Extract code review
- Lint simple_tests.py
- Only reformat alignments file if it exists otherwise change filename
- Update legacy alignments to new format at all stages
- faces_detect.Mask.from_dict - logging format fix
- convert.py fix otf for new pipeline
- cli.py - Add note that masks not used. Revert convert masks
- faces_detect.py - Revert non-extract code
- Add .p and .pickle extensions for serializer
- plugins/extract revert some changes
- scripts/fsmedia - Revert code changes
- Pipeline - cleanup
- Consistant alpha channel stripping (fixes single-process)
- Store landmarks as numpy array
- Code attribution
- Normalize feed face and reference face to 0.0 - 1.0 in convert
- Lock in mask VRAM sized
- Add documentation to plugin_loader
- Update alignments tool to work with new format
2019-10-18 15:44:25 +00:00
torzdf
eceee07241 Legacy alignments update
- Remove legacy update hashes
- Remove legacy job from alignment-tools
- Remove legacy landmark rotation
- Add rotate face method to plugins/extract/detect
- Update travis test for new alignments extension
- Alignments format to .fsa
- Remove serializer option from alignments-tool
- Auto update legacy format alignment files to new format
2019-10-15 16:08:20 +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
bf2510dfc4 Force imageio to use ffmpeg 2019-09-29 00:33:28 +01:00
torzdf
46efae3506 Alignments tool: Remove extract-large and add large option 2019-09-26 18:22:22 +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
78bd012a99 Align Eyes Deprecation - Bugfixes, Linting, and warning removal 2019-09-24 11:19:58 +01:00
kvrooman
139b581177 Align eyes deprecation (#851)
* align eyes removal

* add align_eyes tool
2019-09-24 11:16:03 +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
torzdf
00990c4a35
Gui Updates (#847)
* GUI Improvements

 - Add basic GUI Config options (available in settings menu)
 - Dynamically add/remove columns on settings panel resize
 - Wrap text properly on info headers
 - Fix helptext formatting for configs
 - Standardize Tooltip widths
 - [code] Apply some widget naming
 - [code] Rename radio_columns to option_columns
 - [code] fix column count checking
 - Add Starting Tab config item
 - Add info boxes to main pages
 - Global font settings
 - Add resources to help menu
2019-08-27 23:52:04 +01:00
torzdf
90de8166b5 Interim Preview Tool Fix 2019-08-27 18:50:26 +00:00
kilroythethird
e666384792 Fixed convert bug in preview (#846) 2019-08-27 14:58:24 +01:00
kilroythethird
db60f6037d Fixed support for videos with uppercase ext when using manual align 2019-08-27 12:13:52 +02:00
kilroythethird
95582a81af Fix sort without provided output dir (#845) 2019-08-26 12:18:26 +01:00
torzdf
105af8a02a GUI Tweaks 2019-08-25 11:07:34 +01:00
torzdf
b36b527276 GUI Tweaks
- Fix tootlp formatting
- Revert to single column view
- Fix borders on ungrouped items
- Add individual tooltips for Radio options
- Add more groups
- Remove forced fullscreen
2019-08-25 00:16:56 +01:00
torzdf
eb84869841 GUI Move control helper utils to own module 2019-08-23 17:17:43 +01:00
torzdf
e1fdb25673 Add grouping for GUI options 2019-08-23 02:48:59 +00:00
torzdf
86fc951e03 Bugfix: Manual tool for AMD updates 2019-08-18 12:37:07 +00:00
torzdf
34dd0e890f Bugfix: Alignments tool: Face + Frames count 2019-08-16 01:07:16 +00:00
torzdf
57dc446bd1 Bugfix: Alignments tool. Reference count before being set 2019-08-16 00:02:12 +00:00
kilroythethird
0ec9b31a26 Ensure frames are only counted once (#834) 2019-08-12 22:37:01 +01:00
torzdf
1c29344072 Bugfix: Fix extract/convert hanging when ffmpeg fails to get frame count 2019-08-09 12:17:25 +01:00
torzdf
8e9035b8ed Sort tool. Correctly set TF Verbosity for sort by face 2019-08-02 09:28:49 +00:00
torzdf
0132d32160 Bugfix: Preview Tool - empty tk_var string
- Replace empty tk_vars with 0 for numerical values
2019-07-30 14:51:14 +00:00
torzdf
b6c830c98b Bugfix: Alignments tool: Correctly set items attribute on Check job 2019-07-25 23:12:53 +00:00
tt-cube
65d2b196f9 Update Copy Alignments to use last frame with face (#799)
Changes copy alignment to copy from the last frame with a face rather than just the last frame
2019-07-21 19:55:43 +01: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
Olivier Gagnon
b3443bf047 Manual: Fix typo in command (#793) 2019-07-12 10:52:54 +01:00
torzdf
3896de3dba Bugfixes
Merge Alignments fix
Face Filter. Set default aligner/detector on convert
2019-07-10 09:44:50 +00:00
torzdf
1bf3888af8 Alignments Tool: Fix moving files for processing faces 2019-07-09 17:35:56 +00:00
kilroythethird
838767fe15 Multiple Tools->Alignmet speed ups (#785) 2019-07-09 18:23:41 +01: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
0e12d91ee0 Manual Tool bugfix for bounding box dict 2019-07-06 23:48:18 +00:00
torzdf
8e9c901aeb Bugfix: Extract - Remove BoundingBox object and replace with dict 2019-07-06 09:44:01 +00:00
torzdf
acc6553f80 Remove ffprobe from effmpeg 2019-07-04 23:28:26 +00:00
torzdf
5996948b7c Revert manual tool video reading to cv2 2019-07-04 21:03:15 +00:00
torzdf
7d2da30715 Fix output for alignments tool tasks when input is a video 2019-07-04 11:20:08 +00:00
torzdf
bf9f264565 Replace CV2 video loading with ImageIO 2019-07-04 10:28:14 +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
8bd1389b14 bugfix: Stop convert hanging at the last few frames on some input videos 2019-06-28 00:52:12 +01:00
torzdf
f5adc995f9 AMD Support for Manual Tool 2019-06-25 00:13:39 +01:00
torzdf
6ac422ac27 Extraction Improvements
Default to parallel processing
Add Image normalization options for aligners
2019-06-13 15:22:56 +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
2d3d1a72eb Bugfix: Save full config for preview tool 2019-06-05 14:20:01 +01:00
torzdf
d60b0c38c8 tools: Preview. Fix mask_type pull down 2019-06-02 18:59:29 +01:00
torzdf
a3294523aa Centralize cv2 image reading and handle bad filenames 2019-06-02 16:34:43 +01:00
torzdf
a6a97f7d6f Merge branch 'staging' of https://github.com/deepfakes/faceswap into staging 2019-06-01 16:00:43 +00:00
torzdf
c34389c16b Alignments tool updates
Merge alignments: Add ability to filter out faces that do not appear in the final alignments file
GUI: Add icon to open video file for frames
2019-06-01 15:42:42 +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
236c35f11a
Convert settings tool (#737)
* Initial prediction pipeline and display

* Patch faces from convert pipeline. Load configs

* Add tkinter canvas for image display

* Radio buttons to config gui. Standardise config gui. Remove dssim loss from realface

* Add action frame

* Live update cli options

* Live update config changes

* Quicker frame loading. Refresh faces button callback

* remove debug code

* Add saving and reloading config buttons

* Reduce lag with threading

* Busy indicator + geometry updates

* Fix options canvas resizing

* Add global config saving and resetting

* tools to own tab

* Rename tool to 'preview'

* geometry tweak

* pep8 fixes
2019-05-30 18:15:25 +01:00
torzdf
5c02726587 Add "extract-every-n" option to alignments tool 2019-05-16 19:22:47 +00:00
torzdf
8d1502c202 Sort by face optimizations 2019-05-16 12:19:47 +00:00
torzdf
d2dbd440d8 Sort: Faster sort by face/face-dissim 2019-05-14 18:19:00 +00:00
torzdf
7b12021dc1 Fixups
vgg_face: to own module
vgg_face: correct output and normalization
Extract: more aggressive queue sizes
sys_info: Fix cudnn check error on Linux
2019-05-14 16:06:15 +00:00
torzdf
12d83c6e68
Remove dlib (#725)
* Sort to vgg_face. Remove Face Recognition requirements

* Remove dlib components from setup.py

* Remove dlib from Windows Installer script

* Remove dlib and cmake from requirements.txt

* Update INSTALL.md to remove all dlib requirements

* Remove dlib and cmake from dockerfiles

* Windows installer. Output cli to details Window. Setup.py bugfix

* Skip FaceFilter if invalid paths passed in
2019-05-12 23:24:25 +01:00
torzdf
ab7fa48b8b Remove dlib.rectangles. Replace with BoundingBox class 2019-05-07 10:01:00 +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
Artem Ivanov
0867cc8026 new DFL jpeg alignments support (#705)
* new DFL jpeg alignments support

- Added DFL Jpeg alignments conversion

* linting

* Move import PIL to top of module
2019-04-13 10:50:11 +00:00
torzdf
4eb368f7b8 bugfix: Alignments tool - Extract Large 2019-04-12 21:41:47 +00:00
torzdf
a8e8f9157b Alignments Tool: Allow merging of many alignments file
Adds multi select functionality to GUI, meaning multiple alignments files can now be selected for merging.

Extract: nFilter, Filter now have a file dialog in gui for selecting 1/multiple files
2019-04-12 08:33:39 +00:00
torzdf
39934a51db effmpeg - gen-vid filename bugfix 2019-03-14 11:47:20 +00:00
torzdf
80a6c73c84 Fix effmpeg fps detection and better GUI handling 2019-03-12 12:36:27 +00:00
torzdf
2a2dda0ca9 Add radio buttons for certain GUI options 2019-03-11 18:15:25 +00:00
torzdf
820d57ba5a Alignments Tool. Fix leftover-faces with move flag 2019-03-10 13:02:50 +00:00
torzdf
b07c8cbe48 Alignment tool: rename - fix for identical faces 2019-03-05 11:04:27 +00:00
torzdf
53e664b150 Alignments tool. Bug-fix - multi-faces 2019-02-27 10:52:44 +00:00
torzdf
af97242c3f effmpeg gen-vid bugfix 2019-02-24 14:16:25 +00:00
torzdf
7f34b99aa3 Alignments tool bugfix. Select correct frame on video sources 2019-02-23 13:30:31 +00:00
torzdf
b0e3bdb229 Sort tool. Image grayscale conversion bugfix 2019-02-23 01:50:40 +00:00
torzdf
9134d51ef3 Alignments tool - manual scaling bugfix. Update Install.md 2019-02-23 00:08:37 +00:00