Commit graph

50 commits

Author SHA1 Message Date
Colombo
2167c5cbcb fix of converter when using relighted faces in dst 2019-11-12 17:37:13 +04:00
Colombo
fe58459f36 added FacesetRelighter:
Synthesize new faces from existing ones by relighting them using DeepPortraitRelighter network.
With the relighted faces neural network will better reproduce face shadows.

Therefore you can synthsize shadowed faces from fully lit faceset.
https://i.imgur.com/wxcmQoi.jpg

as a result, better fakes on dark faces:
https://i.imgur.com/5xXIbz5.jpg

in OpenCL build Relighter runs on CPU,

install pytorch directly via pip install, look at requirements
2019-11-11 11:42:52 +04:00
Colombo
e013cb0f6b moving some files 2019-10-14 09:34:44 +04:00
Colombo
7ed38a8097 Converter:
Session is now saved to the model folder.

blur and erode ranges are increased to -400+400

hist-match-bw is now replaced with seamless2 mode.

Added 'ebs' color transfer mode (works only on Windows).

FANSEG model (used in FAN-x mask modes) is retrained with new model configuration
and now produces better precision and less jitter
2019-09-07 13:57:42 +04:00
iperov
407ce3b1ca Added interactive converter.
With interactive converter you can change any parameter of any frame and see the result in real time.

Converter: added motion_blur_power param.
Motion blur is applied by precomputed motion vectors.
So the moving face will look more realistic.

RecycleGAN model is removed.

Added experimental AVATAR model. Minimum required VRAM is 6GB (NVIDIA), 12GB (AMD)
Usage:
1) place data_src.mp4 10-20min square resolution video of news reporter sitting at the table with static background,
   other faces should not appear in frames.
2) process "extract images from video data_src.bat" with FULL fps
3) place data_dst.mp4 video of face who will control the src face
4) process "extract images from video data_dst FULL FPS.bat"
5) process "data_src mark faces S3FD best GPU.bat"
6) process "data_dst extract unaligned faces S3FD best GPU.bat"
7) train AVATAR.bat stage 1, tune batch size to maximum for your card (32 for 6GB), train to 50k+ iters.
8) train AVATAR.bat stage 2, tune batch size to maximum for your card (4 for 6GB), train to decent sharpness.
9) convert AVATAR.bat
10) converted to mp4.bat

updated versions of modules
2019-08-24 12:57:29 +04:00
Auroir
e7562054d0 Fix sorting pathlib objects (#353)
Fixing an issue caused by attempting to sort Path objects. Directly using `<` is unsupported between these, so `sorted()` needs a key specified. 

"PurePath" objects support `>` while normal paths do not, causing the confusion. 
https://docs.python.org/3/library/pathlib.html
2019-08-18 08:01:44 +04:00
Auroir
625bcc212d Return sorted filenames in path_utils (#340)
Linux does not guarantee filenames are returned in any specific order. This leads to exporting frames in random order, sorting them here makes the export run sequentially. Other portions of the program should remain unaffected, if not behave more consistently (E.G. get_first_file_by_stem).

This mostly helpful during exporting. Say you are expecting to not have faces for frames 1000-2000, during your export all the "no faces for..." messages will appear in random order. Since you are expecting to see this you ignore them. If you are also (unexpectedly) missing a face for frame 3000 you will not head the warning since it's mixed up in all the warnings that you are expecting. With this patch export runs in sequential order, you'll see the messages all in a row for frames 1000-2000, then again at 3000. The user is much more likely to see and head the warning this way.

This also allows you to force stop the export midway though and have a contiguous set of frames to encode and preview.
2019-08-12 18:18:55 +04:00
iperov
8484060e01 Trainer: added option for all models
Enable autobackup? (y/n ?:help skip:%s) :
Autobackup model files with preview every hour for last 15 hours. Latest backup located in model/<>_autobackups/01

SAE: added option only for CUDA builds:
Enable gradient clipping? (y/n, ?:help skip:%s) :
Gradient clipping reduces chance of model collapse, sacrificing speed of training.
2019-06-20 10:42:55 +04:00
Luke Barr
ba4e377d13 Don't pass multiprocess object on pickle (#261) 2019-05-14 11:30:23 +04:00
iperov
c0a63addd4 SampleGeneratorFace optimizations 2019-04-24 21:27:05 +04:00
iperov
e58197ca22 initial code to extract umdfaces.io dataset and train pose estimator 2019-04-23 08:14:09 +04:00
iperov
046649e6be
update == 04.20.2019 == (#242)
* superb improved fanseg

* _

* _

* added FANseg extractor for src and dst faces to use it in training

* -

* _

* _

* update to 'partial' func

* _

* trained FANSeg_256_full_face.h5,
new experimental models: AVATAR, RecycleGAN

* _

* _

* _

* fix for TCC mode cards(tesla), was conflict with plaidML initialization.

* _

* update manuals

* _
2019-04-20 08:23:08 +04:00
iperov
5ac7e5d7f1 changed help message for pixel loss:
Pixel loss may help to enhance fine details and stabilize face color. Use it only if quality does not improve over time.

SAE:
previous SAE model will not work with this update.
Greatly decreased chance of model collapse.
Increased model accuracy.
Residual blocks now default and this option has been removed.
Improved 'learn mask'.
Added masked preview (switch by space key)

Converter:
fixed rct/lct in seamless mode
added mask mode (6) learned*FAN-prd*FAN-dst

added mask editor, its created for refining dataset for FANSeg model, and not for production, but you can spend your time and test it in regular fakes with face obstructions
2019-04-04 10:22:53 +04:00
iperov
85c01e3b4a Converter: added Apply super resolution? (y/n skip:n) : , Enhance details by applying DCSCN network.
refactorings
2019-03-28 21:50:27 +04:00
iperov
b03b147bae refactoring 2019-03-26 11:09:44 +04:00
iperov
a3df04999c removing trailing spaces 2019-03-19 23:53:27 +04:00
iperov
7c1ea1a617 removing dflimg image_to_face_mat 2019-03-18 14:42:10 +04:00
iperov
1d56585f33 fix ability for auto re-extract dst faces, after this update DFL torrent extractor scripts will not work. 2019-03-18 01:12:04 +04:00
iperov
f3b343c0e5 small fixed and refactorings 2019-03-16 20:55:51 +04:00
iperov
5587c93e01 fix ConverterMasked.py,
changing requirements
changing device.py ENV vars
2019-03-07 19:48:12 +04:00
iperov
26741f3376 upd set_process_lowest_prio() 2019-03-03 21:59:28 +04:00
iperov
69af01d871 update set_process_lowest_prio() 2019-03-03 21:59:10 +04:00
iperov
4196e962a8 added VideoEd - operating video files by ffmpeg from python. 2019-03-02 14:58:22 +04:00
iperov
438213e97c manual extractor: increased FPS,
sort by final : now you can specify target number of images,
converter: fix seamless mask and exception,
huge refactoring
2019-02-28 11:56:31 +04:00
iperov
72ba6b103c added support of AMD videocards
added Intel's plaidML backend to use OpenCL engine. Check new requirements.
smart choosing of backend in device.py
env var 'force_plaidML' can be choosed to forced using plaidML
all tf functions transferred to pure keras
MTCNN transferred to pure keras, but it works slow on plaidML (forced to CPU in this case)
default batch size for all models and VRAMs now 4, feel free to adjust it on your own
SAE: default style options now ZERO, because there are no best values for all scenes, set them on your own.
SAE: return back option pixel_loss, feel free to enable it on your own.
SAE: added option multiscale_decoder default is true, but you can disable it to get 100% same as H,DF,LIAEF model behaviour.
fix converter output to .png
added linux fork reference to doc/doc_build_and_repository_info.md
2019-02-19 17:33:12 +04:00
iperov
2bd983703e ConverterMasked: removed default transfercolor,
added Apply color transfer to predicted face - modes rct / lct
2019-02-13 16:27:57 +04:00
iperov
06fe1314d8 removing default yaw_value from DFLIMG files,
added better pitch/yaw estimator from 68 landmarks,
improving face yaw accuracy for sorting and trainers,
added sort by face-pitch
2019-02-12 21:31:37 +04:00
iperov
4d37fd62cd fix DFLJPG,
SAE: added "rare sample booster"
SAE: pixel loss replaced to smooth transition from DSSIM to PixelLoss in 15k epochs by default
2019-02-09 18:53:37 +04:00
iperov
5a1fb199f4 added support of non-english characters in paths 2019-02-05 19:33:55 +04:00
iperov
6d95dd4a99 DFL now works with JPG files by default. Old PNG files also supported. Added util convertor PNG to JPG. 2019-02-04 19:47:24 +04:00
iperov
41abda42d2 SampleProcessor now uses CUBIC interpolation (was LANCSOZ4) in order to reduce CPU usage 2019-02-03 19:19:42 +04:00
iperov
72646becd1 forcing all tqdm's to ascii in order to work properly on Chinese windows 2019-01-24 21:32:07 +04:00
iperov
b6c4171ea1 optimizations of nnlib and SampleGeneratorFace,
refactorings
2019-01-22 11:52:04 +04:00
iperov
ba06a71fff SAE: changed default style power to 10.0 . Now style power is floating number in valid range 0.0 to 100.0 2019-01-14 21:24:33 +04:00
iperov
48d0123f0b SAE: new options face_style_power, bg_style_power instead of style_power. Zero - means dont use style.
SAE: new option 'lighter_encoder'.
Now model settings can be overrided by pressing enter in 2 seconds while model loading (works on Windows).
Removed all MultiGPU models, because keras multi_gpu in fact doesn't work.
2019-01-10 18:28:12 +04:00
iperov
1a2555e160 added '?' help for model options. Added 'Src face scale modifier' to model options. 2019-01-09 09:22:22 +04:00
iperov
b5ba7d52cb increased speed of sort by hist sim for ten thousands of faces 2019-01-04 22:54:09 +04:00
iperov
5f80ea0513 added missing file 2019-01-02 18:38:11 +04:00
iperov
7b70e7eec1 added new model U-net Face Morpher.
removed AVATAR - useless model was just for demo
removed MIAEF128 - use UFM insted
removed LIAEF128YAW - use model option sort by yaw on start for any model
All models now ask some options on start.
Session options (such as target epoch, batch_size, write_preview_history etc) can be overrided by special command arg.
Converter now always ask options and no more support to define options via command line.
fix bug when ConverterMasked always used not predicted mask.
SampleGenerator now always generate samples with replicated border, exclude mask samples.
refactorings
2019-01-02 17:26:12 +04:00
iperov
f8824f9601 refactoring. Added RecycleGAN for testing. 2018-12-28 19:38:52 +04:00
iperov
8686309417 fix SubprocessorBase 2018-12-26 11:07:01 +04:00
iperov
dba951412c fix DFLPNG 2018-12-25 19:49:19 +04:00
iperov
6f99f14a6d SubprocessorBase fix 2018-12-25 19:48:34 +04:00
iperov
8a223845fb refactoring 2018-12-24 13:45:40 +04:00
iperov
9926dc626a refactorings, improved sort by hist-dissim 2018-12-20 12:43:00 +04:00
iperov
98ee1bb339 Added option hist-match threshold, used for decrease artifacts of hist-match.
Fix terminating converter thread in debug mode.
Added DeepFaceLab converter overview to readme.
2018-12-14 10:40:46 +04:00
iperov
5c43f4245e transfercolor via lab converter now implemented by tensorflow-cpu, which is x2 faster than skimage.
We cannot use GPU for lab converter in converter multiprocesses, because almost all VRAM ate by model process, so even 300Mb free VRAM not enough for tensorflow lab converter.
Removed skimage dependency.
Refactorings.
2018-12-01 12:11:54 +04:00
iperov
6f0d38d171 converter added --final-image-color-degrade-power - Degrades colors of final image to hide face problems. Valid range [0..100] 2018-11-30 20:08:30 +04:00
Christopher Throwaway
a74b57d6e5 Improve Manual Extraction process
Adds improvements to the manual selection process. You can now
click to lock the selection box, and can also go forward and backwards
to modify selections after they have been made. You can also now push
'Q' to skip all remaining images to quickly save the extractions you
have already made.
2018-06-27 21:32:35 -05:00
iperov
6bd5a44264 initial 2018-06-04 17:12:43 +04:00