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

45 commits

Author SHA1 Message Date
torzdf
ab4ef75671 Extract - Allow multiple pipelines to be loaded 2020-04-02 15:53:29 +01:00
torzdf
bb3e3d0f16 Extraction - Auto generate Components and Extended Masks 2020-03-30 19:24:29 +01:00
torzdf
e7c5b7b633 Bugfix: cv2-dnn aligner - Assertion image is empty error 2020-03-29 18:24:58 +01:00
torzdf
924d53789b
Core updates (#982)
* plugins.extract.align
  - Expose normalization method

* lib.gui core updates
  - Minor updates to support future development.
2020-03-10 14:48:12 +00:00
torzdf
e58fd535d5 bugfix: CV2-DNN aligner. Fix Assertion error when bounding box falls out of frame 2020-03-06 12:10:40 +00:00
torzdf
4fdeb67fba Bugfix - Manual tool. Use new ExtractMedia class 2019-11-29 23:53:00 +00:00
torzdf
46309771bb plugins.extract - Create ExtractMedia class for pipeline flow
Bugfix - Fix memory leak in extract
2019-11-29 00:46:27 +00:00
Kyle
d5c2063459 fix to error on out of bounds 2019-11-15 18:09:12 -06:00
torzdf
e4b7717c64 Minor fixes 2019-11-15 20:16:45 +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
36be6cd4d8 Vectorize FAN post-processing (#926) 2019-11-14 13:01:35 +00:00
kvrooman
b49c352e8f # pylint:disable=no-member cleanup (#927)
# pylint:disable=no-member cleanup
2019-11-13 12:17:59 +00:00
torzdf
ad035f2a24 Optimize Extract parallel VRAM allocation 2019-10-19 23:53:42 +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
kvrooman
995a857154 Smart Mask Exposure for Extraction & Training (#831)
Smart Masks - Initial Commit
2019-10-07 16:16:18 +01:00
torzdf
29a75b90d4 Extract: Expose "allow_growth" option 2019-09-29 12:06:04 +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
2f0fe704af Fixups
GUI: Fix thumbnail calculation + add borders
cv2-dnn aligner: Remove debug code
Convert: FFMpeg plugin - retry muxing audio on failure and properly error handle
2019-07-06 16:27:11 +00:00
torzdf
8e9c901aeb Bugfix: Extract - Remove BoundingBox object and replace with dict 2019-07-06 09:44:01 +00:00
kilroythethird
67d4ff9df0 Added keras version of FAN for plaidml backends (#756)
* Added keras version of FAN for plaidml backends

* Added supports_plaidml flag to fan_amd
2019-06-22 18:58:36 +01:00
torzdf
11f35fa798 Fix Active Devices for plaidML. Add Supports PlaidML to Extractors 2019-06-20 18:25:28 +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
40ed94f200 Bugfixes
sysinfo,py: CUDNN Check fix for unsupported OSes
cli.py: More useful information
scripts/convert.py: Set processes to 1 if no images are passed in
cv2_dnn aligner: Fix bounding box for negative values
scripts/convert.py: Fix for incorrect frame ranges passed in
2019-05-20 12:57:52 +01:00
torzdf
148318778c
Face filter vgg face (#724)
* Implement extraction pipeline

* Face filter to vgg_face. Resume partial model downloads

* On-the-fly conversion to extraction pipeline

* Move git model ids from get_model to model definition
2019-05-11 18:43:09 +01:00
torzdf
ab7fa48b8b Remove dlib.rectangles. Replace with BoundingBox class 2019-05-07 10:01:00 +00:00
torzdf
ffd72b32d6 Remove all saved models from repo
All models now download when required
Model downloader can handle multiple files in model
2019-05-07 00:18:08 +00:00
torzdf
7904b32101 Remove Dlib Aligner
Remove Dlib Aligner
Add CV2-DNN Aligner replacement for dlib
Remove aligner models from repo
Add download function to pull models from remote location
Minor FAN fixups
2019-05-06 17:15:14 +00:00
torzdf
d8843abe2e Better aligner error handling on initialization 2019-03-09 12:51:09 +00:00
torzdf
7e8cc4c5be Move mp logging functions to multithreading module 2019-03-03 13:05:25 +00:00
torzdf
01df9c1090 Convert FAN to run on CPU as well as GPU 2019-02-24 03:23:53 +00:00
bryanlyon
bfc73f9d06 Fan error message (#616)
* More useful FAN failure error message

Just added instructions on how to use the DLIB alignment when CPU-only is used for extract.

* Typo fix.
2019-02-21 19:35:07 +00:00
Lorjuo
d211795625 Staging sort fix (#584)
* fixed several bugs that prevented sort algorithms from beeing working in staging branch.
face-cnn, face-cnn-dissim and face-yaw now working again
blur, face, hist, hist-dissim already worked before
face-dissim still has an error

* applied requested changes from torzdf
2019-01-18 00:45:48 +00:00
torzdf
890d1711c7 Merge branch 'master' into staging 2019-01-15 23:56:53 +00:00
torzdf
49812ace73 Log traceback on extract exception during init 2019-01-15 23:56:17 +00:00
Lorjuo
e9ea863b29 detection bugfixes: (#577)
-scale in detector has been used as a member variable and shared between multiple threads. however scale heavily depends on the concrete image. if thread change occurs between calculation of scale, actual detection and postprocessing, then random behaviour and exceptions might happen. especially in the case of input images with varying sizes this might cause negative effects

-wrong scale factor calculation:
scale factor was calculated as: scale = target / source
whereas target and source are variables for the total number of pixels in the image (= width * height)
However, later on it was applied on the individual dimensions/components as width/height independantly:
e.g.: dims = (int(width * scale), int(height * scale))
or: int(face.left() / scale),

therefore scaling factor often was too small and detection for very big input images was performed on very small intermediate images
Therefore calculation has been changed to:
scale = sqrt(target / source)
2019-01-06 17:44:05 +00:00
torzdf
58b291fa77 bugfix: Handle FAN detection errors 2018-12-31 13:31:50 +00:00
torzdf
45b5072efb Correctly Error out on FAN CPU 2018-12-15 00:28:52 +00:00
torzdf
7f53911453
Logging (#541)
* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training
2018-12-04 13:31:49 +00:00
torzdf
4f4fb27410 extractor fixes 2018-11-21 17:58:41 +00:00
torzdf
fb76438615 Remove DetectedFace object from plugins due to multiprocess error 2018-11-20 10:20:01 +00:00
torzdf
2783c27e00
Fix convert-adjust (#531)
* Add dimensions to alignments + refactor

* Add frame_dims + funcs to DetectFaces. Add alignments lib

* Convert Adjust working

* Refactor and tidy up
2018-11-07 20:21:22 +00:00
torzdf
ff10868476 Increase FAN timeout. Fallback sort and manual align to Dlib for CPU 2018-10-28 16:57:51 +00:00
torzdf
7b2cf02390 Bugfixes 2018-10-27 23:52:09 +01:00
torzdf
ca63242996
Extraction - Speed improvements (#522) (#523)
* Extraction - Speed improvements (#522)

* Initial Plugin restructure

* Detectors to plugins. Detector speed improvements

* Re-implement dlib aligner, remove models, FAN to TF. Parallel processing

* Update manual, update convert, implement parallel/serial switching

* linting + fix cuda check (setup.py). requirements update keras 2.2.4

* Add extract size option. Fix dlib hog init

* GUI: Increase tooltip width

* Update alignment tool to support new DetectedFace

* Add skip existing faces option

* Fix sort tool to new plugin structure

* remove old align plugin

* fix convert -skip faces bug

* Fix convert skipping no faces frames

* Convert - draw onto transparent layer

* Fix blur threshold bug

* fix skip_faces convert bug

* Fix training
2018-10-27 10:12:08 +01:00