1
0
Fork 0
mirror of https://github.com/deepfakes/faceswap synced 2025-06-08 11:53:26 -04:00
Commit graph

18 commits

Author SHA1 Message Date
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
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
torzdf
3c83a068ff Add option to change dlib-cnn buffer size 2018-09-06 11:16:55 +01:00
torzdf
e76ab16bfe
Effmpeg preview, MTCNN Extractor. HiRes model fixes (#458)
* Add preview functionality to effmpeg.  (#435)

* Add preview functionality to effmpeg.

effmpeg tool:
Preview for actions that have a video output now available.
Preview does not work when muxing audio.

* Model json unicode fix1 (#443)

* fixed Windows 10 path error while loading weights

* - fixed TypeError: the JSON object must be str, not 'bytes' with OriginalHighRes Model

* MTCNN Extractor and Extraction refactor (#453)

* implement mtcnn extractor

* mtcnn refactor and vram management changes

* cli arguments update for mtcnn/dlib split

* Add mtcnn models to gitignore

* Change multiprocessing on extract

* GUI changes to handle nargs defaults

* Early exit bugfix (#455)

* Fix extract early termination bug

* Fix extract early exit bug

* Multi face detection bugfix (#456)

* Multi face extraction fix

* Original high res cleanup 1 (#457)

* slight model re-factoring
  - removed excess threading code
  - added random kernel initialization to dense layer

* Slight OriginalHighRes re-factoring an code cleanup
2018-07-03 10:42:58 +02:00
babilio
83c36b9489 Improving performance of extraction. Two main changes to improve the … (#259)
* Improving performance of extraction. Two main changes to improve the most recent modifications to extract: 1st FaceLandmarkExtractor would try to use cnn first, then try hog. The problem was that this reduced the speed by 4 for images where cnn didn't find anything, and most of the times hog wouldn't find anything either or it would be a bad extract. For me it wasn't worth it. With this you can specify on input -D if you want to use hog, cnn, or all. 'all' will try cnn, then hog like FaceLandmarkExtractor was doing. cnn or hog will just use 1 detection method. 2nd change is a rehaul of the verbose parameter. Now warnings when a face is not detected will just be shown if indicated by -v or --verbose. This restores the verbose function to what it once was. With this change I was able to process 1,000 per each 4 minutes regardless if faces were detected or not. Performance improvement just applies to not detected images but I normally will have lots of images without clear faces in my set, so I figured it would impact others. Also the introduction of 'all' would allow trying other models together more easily in the future.

* Update faces_detect.py

* Update extract.py

* Update FaceLandmarksExtractor.py

* spacing fix
2018-03-11 11:36:50 +01:00
torzdf
0ea743029d Fix for missing default rotation value (#269)
* Image rotator for extract and convert ready for testing

* Revert "Image rotator for extract and convert ready for testing"

This reverts commit bbeb19ef26.

Error in extract code

* add image rotation support to detect more faces

* Update convert.py

Amended to do a single check for for rotation rather than checking twice. Performance gain is likely to be marginal to non-existent, but can't hurt.

* Update convert.py

remove type

* cli.py: Only output message on verbose. Convert.py: Only check for rotation amount once

* Changed command line flag to take arguments to ease future development

* Realigning for upstream/Master

* Minor fix

* Change default rotation value from None to 0
2018-03-10 19:46:08 +01:00
torzdf
ee6bc40224 Add image rotation for detecting more faces and dealing with awkward angles (#253)
* Image rotator for extract and convert ready for testing

* Revert "Image rotator for extract and convert ready for testing"

This reverts commit bbeb19ef26.

Error in extract code

* add image rotation support to detect more faces

* Update convert.py

Amended to do a single check for for rotation rather than checking twice. Performance gain is likely to be marginal to non-existent, but can't hurt.

* Update convert.py

remove type

* cli.py: Only output message on verbose. Convert.py: Only check for rotation amount once

* Changed command line flag to take arguments to ease future development

* Realigning for upstream/Master

* Minor fix
2018-03-10 13:34:19 +01:00
iperov
232d9313af port 'face_alignment' from PyTorch to Keras. (#228)
* port 'face_alignment' from PyTorch to Keras. It works x2 faster, but initialization takes 20secs.

2DFAN-4.h5 and mmod_human_face_detector.dat included in lib\FaceLandmarksExtractor

fixed dlib vs tensorflow conflict: dlib must do op first, then load keras model, otherwise CUDA OOM error

if face location not found by CNN, its try to find by HOG.

removed this:
-        if face.landmarks == None:
-            print("Warning! landmarks not found. Switching to crop!")
-            return cv2.resize(face.image, (size, size))
because DetectedFace always has landmarks

* removing DetectedFace.landmarks
2018-03-01 11:32:11 +01:00
Gareth Dunstone
29eec42594 Added serializers.
This speeds up convert speed x4 on my machine.
2018-02-09 02:44:31 +11:00
Clorr
b3ae6130ed
Misc updates on master before GAN. Added multithreading + mmod face detector (#109)
* Preparing GAN plugin

* Adding multithreading for extract

* Adding support for mmod human face detector

* Adding face filter argument

* Added process number argument to multiprocessing extractor.

Fixed progressbar for multiprocessing.

* Added tiff as image type.
compression artefacts hurt my feelings.

* Cleanup
2018-02-07 13:42:19 +01:00
Clorr
34945cfcd7
Adding models as plugins + Face filtering (#53) + #39 + #43 + #44 + #49 (#61)
* Making Models as plugins

* Do not reload model on each image #39 + Adding FaceFilter #53

* Adding @lukaville PR for #43 and #44 (possibly)

* Training done in a separate thread

* Better log for plugin load

* Adding a prefetch to train.py #49
(Note that we prefetch 2 batches of images, due to the queue behavior)
+ More compact logging with verbose info included

* correction of DirectoryProcessor signature

* adding missing import

* Convert with parallel preprocessing of files

* Added coverage var for trainer

Added a var with comment. Feel free to add it as argument

* corrections

* Modifying preview and normalization of image + correction

* Cleanup
2018-01-31 18:56:44 +01:00
Clorr
bb489f4f51 Adding new plugins (Extract_Align & Convert_Masked) 2018-01-03 10:33:42 +01:00
Clorr
3e2976ab03 Adding plugins 2018-01-03 10:33:39 +01:00
Hidde Jansen
7f7f110933
Command line options for convert.py (#13)
* Rewrite extract.py, make code re-usable for conversion too.

* Add convert.py, adding command line options
2017-12-22 01:52:47 +01:00
Clorr
f542c58a48 Adding face_recognition
Added face_recongition from
https://github.com/ageitgey/face_recognition/

It is based on dlib, but does not have the glitches I had previously!

Also reworked Dockerfile (sticking to Python2 for now)
2017-12-21 23:13:47 +01:00
Clorr
fb9f641ccd Adding a DetectedFace class to retain face data 2017-12-21 21:31:05 +01:00
Hidde Jansen
d0c02a2ba8
PEP8 / Codestyle (#11) 2017-12-20 21:27:14 +01:00
Colin LORRAIN
845a6ae0c6 Creating lib folder 2017-12-19 12:57:56 +01:00
Renamed from faces_detect.py (Browse further)