Commit graph

627 commits

Author SHA1 Message Date
Colombo
9e80bbc917 1 2019-09-21 15:19:58 +04:00
Colombo
62682351ac fix avatar model 2019-09-21 14:48:40 +04:00
Colombo
2a3b3f0021 added tf_cpu_mode option for funit models 2019-09-21 09:44:34 +04:00
Colombo
d9d10f91c2 S3FD and 2DFAN-4 were improperly ported from pytorch. now fixed. 2019-09-20 17:16:37 +04:00
Colombo
e928ee0d30 1 2019-09-19 19:36:46 +04:00
Colombo
ef90316f27 1 2019-09-19 17:29:12 +04:00
Colombo
a325d0353b fix 2019-09-19 11:20:30 +04:00
Colombo
c06d073936 1 2019-09-19 11:16:35 +04:00
Colombo
dc11ec32be SAE : WARNING, RETRAIN IS REQUIRED !
fixed model sizes from previous update.
avoided bug in ML framework(keras) that forces to train the model on random noise.

Converter: added blur on the same keys as sharpness

Added new model 'TrueFace'. This is a GAN model ported from https://github.com/NVlabs/FUNIT
Model produces near zero morphing and high detail face.
Model has higher failure rate than other models.
Keep src and dst faceset in same lighting conditions.
2019-09-19 11:13:56 +04:00
Colombo
201b762541 SAE: fix 2019-09-14 16:39:47 +04:00
Colombo
b6b92bded0 converter: now writes a filename of current frame config,
SAE: removed multiscale decoder, because it's not effective
2019-09-13 08:59:00 +04:00
Colombo
bef4e5d33c Converter: added new color transfer modes: mkl, mkl-m, idt, idt-m 2019-09-07 22:01:01 +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
Colombo
70dada42ea fix 2019-09-06 14:52:46 +04:00
Colombo
faa14c4e59 fix extractor error on load grayscale images 2019-09-06 11:54:49 +04:00
Colombo
bc0b25cdda interactive converter now saves the session.
if input frames are changed (amount or filenames)
then interactive converter automatically starts a new session.
if model is more trained then all frames will be recomputed again with their saved configs.
2019-08-30 16:19:41 +04:00
Colombo
bac9d5a99d nothing interesting 2019-08-30 09:49:07 +04:00
Colombo
9f58d160a0 Converter: fix output names of merged files, now its 100% same as input,
ConvertAvatar: fix input image after fix landmarks face align,
VideoEd: video_from_sequence now uses pipe input to input any filenames instead of %.5d. formatted
2019-08-27 22:05:22 +04:00
iperov
23854ac8bc removing landmarks of lips which are used in face aligning, and leave only corners of mouth landmarks,
result: less scale jittering aligning that will be feeded into AE and produce more stable face
before: https://i.imgur.com/gJaW5Y4.gifv
after: https://i.imgur.com/Vq7gvhY.gifv
2019-08-26 19:36:41 +04:00
iperov
fb4837b3cb fix converter 2019-08-26 11:03:57 +04:00
iperov
78ddd51ffc fix interactive converter 2019-08-26 10:47:20 +04:00
iperov
96d0e3fbee converter output filename - fixed indexing, now starts from 00001 as extracted frames 2019-08-26 10:39:04 +04:00
iperov
029cabea3d minor fix 2019-08-26 10:03:10 +04:00
iperov
d3eadbf5f3 upd readme 2019-08-26 09:51:32 +04:00
iperov
6243190f74 fix help screen 2019-08-26 08:14:31 +04:00
iperov
25da22fdc9 minor fix 2019-08-25 22:32:21 +04:00
iperov
63d30c49ae fixes and optimizations,
converters: added new option sharpen_mode and sharpen_amount
2019-08-25 19:18:51 +04:00
iperov
c39ed9d9c9 updated pdf manuals for AVATAR model.
Avatar converter: added super resolution option.
All converters: super resolution DCSCN network is now replaced by RankSRGAN
2019-08-25 17:43:52 +04:00
iperov
19c66286da fix gen_warp_params now accepts any square images 2019-08-25 14:06:33 +04:00
iperov
6c66495bcf default avatar type option is now HEAD. Head produces stable result. 2019-08-25 08:16:54 +04:00
iperov
d129b5dd7f sort data for CAInitializerMP 2019-08-25 07:50:27 +04:00
iperov
00dce38187 fix 2019-08-25 07:43:22 +04:00
iperov
b572b8f4d4 fix ConverterConfig 2019-08-25 00:30:05 +04:00
iperov
e3505d9b8c fix AVATARModel 2019-08-24 20:33:29 +04:00
iperov
5968ac21f6 fix AVATARModel 2019-08-24 19:55:38 +04:00
iperov
2a9a579436 fix 2019-08-24 13:23:15 +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
iperov
3f0bf2e994 upd readme 2019-08-20 17:11:37 +04:00
iperov
4058f51c02 Merge branch 'master' of https://github.com/iperov/DeepFaceLab 2019-08-20 17:10:31 +04:00
iperov
fc5efb559d upd readme 2019-08-20 17:10:00 +04:00
Luke Barr
a33ef50da5 Long startup time on Linux (#356) 2019-08-19 22:56:54 +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
a906f24a4d Fix log_info/log_err printing with progress bars (#349) 2019-08-17 11:20:10 +04:00
Auroir
c4e68ef539 Formatted Model Summary (#348)
* Formatted Model Summary

Aligns the model summary output using f-string formatting. The logic structure of the base class has not been changed, only the lines put into `model_summary_text`. Output width is calculated from keys & values and will scale to show a clean summary for any model/platform.

GPU VRAM has been added as an output. Incorrect detection of VRAM is possible in broken environments and GPUs of different sizes can report the same name. Showing it here adds clarity for the user and for issue tickets.

Concatenation changed from "\r\n" to "\n", CRLF end of lines for Windows are handled transparently so using it here caused extra blank lines in the summary txt file.

**Examples:**
Using CUDA + SAE-LIAE
```
============= Model Summary ==============
==                                      ==
==         Model name: SAE              ==
==                                      ==
==  Current iteration: 16               ==
==                                      ==
==----------- Model Options ------------==
==                                      ==
==         batch_size: 4                ==
==        sort_by_yaw: False            ==
==        random_flip: True             ==
==         resolution: 128              ==
==          face_type: f                ==
==         learn_mask: True             ==
==     optimizer_mode: 1                ==
==              archi: liae             ==
==            ae_dims: 256              ==
==          e_ch_dims: 42               ==
==          d_ch_dims: 21               ==
== multiscale_decoder: False            ==
==         ca_weights: False            ==
==         pixel_loss: False            ==
==   face_style_power: 0.0              ==
==     bg_style_power: 0.0              ==
==    apply_random_ct: False            ==
==           clipgrad: False            ==
==                                      ==
==------------- Running On -------------==
==                                      ==
==       Device index: 0                ==
==               Name: GeForce GTX 1080 ==
==               VRAM: 8.00GB           ==
==                                      ==
==========================================
```
Colab
```
========== Model Summary ==========
==                               ==
==         Model name: SAE       ==
==                               ==
==  Current iteration: 39822     ==
==                               ==
==-------- Model Options --------==
==                               ==
==         batch_size: 24        ==
==        sort_by_yaw: True      ==
==        random_flip: False     ==
==         resolution: 128       ==
==          face_type: f         ==
==         learn_mask: True      ==
==     optimizer_mode: 2         ==
==              archi: liae      ==
==            ae_dims: 222       ==
==          e_ch_dims: 34        ==
==          d_ch_dims: 16        ==
== multiscale_decoder: True      ==
==         ca_weights: True      ==
==         pixel_loss: False     ==
==   face_style_power: 2.0       ==
==     bg_style_power: 1.5       ==
==    apply_random_ct: False     ==
==           clipgrad: True      ==
==                               ==
==--------- Running On ----------==
==                               ==
==       Device index: 0         ==
==               Name: Tesla K80 ==
==               VRAM: 11.00GB   ==
==                               ==
===================================
```
Using OpenCL + H128
```
=========================== Model Summary ===========================
==                                                                 ==
==        Model name: H128                                         ==
==                                                                 ==
== Current iteration: 0                                            ==
==                                                                 ==
==------------------------- Model Options -------------------------==
==                                                                 ==
==        batch_size: 4                                            ==
==       sort_by_yaw: False                                        ==
==       random_flip: True                                         ==
==        lighter_ae: False                                        ==
==        pixel_loss: False                                        ==
==                                                                 ==
==-------------------------- Running On ---------------------------==
==                                                                 ==
==      Device index: 0                                            ==
==              Name: Advanced Micro Devices, Inc. gfx900 (OpenCL) ==
==              VRAM: 7.98GB                                       ==
==                                                                 ==
=====================================================================
```
Using CPU (output trimmed)
```
==------- Running On --------==
==                           ==
==       Using device: CPU   ==
==                           ==
===============================
```
multi_gpu support is retained (output trimmed)
```
==------------- Running On -------------==
==                                      ==
==    Using multi_gpu: True             ==
==                                      ==
==       Device index: 1                ==
==               Name: Geforce GTX 1080 ==
==               VRAM: 8.00GB           ==
==       Device index: 2                ==
==               Name: Geforce GTX 1080 ==
==               VRAM: 8.00GB           ==
==                                      ==
==========================================
```

Low VRAM warning (output trimmed)
```
==------------- Running On -------------==
==                                      ==
==       Device index: 0                ==
==               Name: Geforce GTX 1050 ==
==               VRAM: 2.00GB           ==
==                                      ==
==========================================
/!\
/!\ WARNING:
/!\ You are using a GPU with 2GB or less VRAM. This may significantly reduce the quality of your result!
/!\ If training does not start, close all programs and try again.
/!\ Also you can disable Windows Aero Desktop to increase available VRAM.
/!\
```

* Fix indent
2019-08-16 18:35:27 +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
d16759bcd3 ConverterMasked: added mask gradient of bottom area, same as side gradient 2019-08-11 13:22:01 +04:00
iperov
e8c5f168bd Merge branch 'master' of https://github.com/iperov/DeepFaceLab 2019-08-11 11:17:38 +04:00
iperov
b72d5a3f9a fixed error "Failed to get convolution algorithm" on some systems
fixed error "dll load failed" on some systems
Expanded eyebrows line of face masks. It does not affect mask of FAN-x converter mode.
2019-08-11 11:17:22 +04:00
Josh Johnson
e2bc65d5f0 Fix issue with RTX GPU and TensorFlow (#322)
An issue affecting at least 2070 and 2080 cards (possibly other RTX cards too) requires auto growth to be enabled for TensorFlow to work.

I don't know enough about the impact of this change to know whether this ought to be made optional or not, but for RTX owners, this simple change fixes TensorFlow errors when generating models.
2019-08-02 16:40:41 +04:00
fakerdaker
582c974851 Colab choose random preview (#316) 2019-07-25 11:29:31 +04:00