Commit graph

69 commits

Author SHA1 Message Date
Colombo
d46fb5cfd3 fixed mask editor
added FacesetEnhancer
4.2.other) data_src util faceset enhance best GPU.bat
4.2.other) data_src util faceset enhance multi GPU.bat

FacesetEnhancer greatly increases details in your source face set,
same as Gigapixel enhancer, but in fully automatic mode.
In OpenCL build it works on CPU only.

Please consider a donation.
2019-12-26 21:27:10 +04:00
Colombo
e8673e3fcc nothing interesting 2019-12-11 22:33:23 +04:00
Colombo
77b390c04b 1 2019-11-24 19:51:07 +04:00
Colombo
05153d9ba5 FacesetRelighter fixes and improvements:
now you have 3 ways:
1) define light directions manually (not for google colab)
   watch demo https://youtu.be/79xz7yEO5Jw
2) relight faceset with one random direction
3) relight faceset with predefined 8 directions
2019-11-11 19:56:36 +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
770c70d778 converter:
fixed crashes

removed useless 'ebs' color transfer

changed keys for color degrade

added image degrade via denoise - same as denoise extracted data_dst.bat ,
but you can control this option directly in the interactive converter

added image degrade via bicubic downscale and upscale

SAEHD: default ae_dims for df now 256.
2019-11-09 15:12:35 +04:00
Colombo
734d97d729 added 'sort by vggface': sorting by face similarity using VGGFace model.
Requires 4GB+ VRAM and internet connection for the first run.
2019-10-23 15:06:39 +04:00
Colombo
92f14dee70 SAEHD: added option Enable random warp of samples, default is on
Random warp is required to generalize facial expressions of both faces. When the face is trained enough, you can disable it to get extra sharpness for less amount of iterations.
2019-10-12 10:31:50 +04:00
Colombo
59ad734b6c fixed GPU indexing 2019-10-10 13:13:36 +04:00
Colombo
3f23135982 SAEHD: speed up for nvidia, duplicate code clean up 2019-10-08 21:02:20 +04:00
Colombo
d781af3d1f fixed GPU detection and indexes, got rid of using nvml, now using direct cuda lib to determine gpu info that match tensorflow indexes,
removed TrueFace model.

added SAEv2 model. Differences from SAE:
+ default e_ch_dims is now 21
+ new encoder produces more stable face and less scale jitter
  before: https://i.imgur.com/4jUcol8.gifv
  after:  https://i.imgur.com/lyiax49.gifv - scale of the face is less changed within frame size
+ decoder now has only 1 residual block instead of 2, result is same quality with less decoder size
+ added mid-full face, which covers 30% more area than half face.
+ added option " Enable 'true face' training "
  Enable it only after 50k iters, when the face is sharp enough.
  the result face will be more like src.
  The most src-like face with 'true-face-training' you can achieve with DF architecture.
2019-10-05 16:26:23 +04:00
Colombo
353bcdf80f cuda_cache_max_size 2019-10-02 20:17:56 +04:00
Colombo
8041ee959a nnlib initialization: fix choosing best gpu when indexes of gpu are different in tf and nvsmi 2019-09-27 18:47:18 +04:00
Colombo
4a2203cc35 adding kernel initializer option to FUNITAdain block 2019-09-24 21:30:28 +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
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
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
bac9d5a99d nothing interesting 2019-08-30 09:49:07 +04:00
iperov
d129b5dd7f sort data for CAInitializerMP 2019-08-25 07:50:27 +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
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
iperov
c9da4cd89b fix for plaidML 2019-05-24 09:30:39 +04:00
iperov
bde700243c fix for plaidML 2019-05-05 19:22:26 +04:00
iperov
0cd8dd7296 upd comment 2019-04-24 11:41:10 +04:00
iperov
947feac047 refactorings 2019-04-24 11:28:58 +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
4683c362ac changing SubpixelUpscaler to variable H,W dims,
tensorflow backend : using depth_to_space in SubpixelUpscaler, so training speed increased by 4%
2019-03-28 17:55:42 +04:00
iperov
bb02cc1d97 _ 2019-03-25 13:28:08 +04:00
iperov
37505d88e3 old SAE model will not work with this update.
Fixed bug when SAE can be collapsed during a time.

SAE: removed CA weights and encoder/decoder dims.

added new options:

Encoder dims per channel (21-85 ?:help skip:%d)
More encoder dims help to recognize more facial features, but require more VRAM. You can fine-tune model size to fit your GPU.

Decoder dims per channel (11-85 ?:help skip:%d)
More decoder dims help to get better details, but require more VRAM. You can fine-tune model size to fit your GPU.

Add residual blocks to decoder? (y/n, ?:help skip:n) :
These blocks help to get better details, but require more computing time.

Remove gray border? (y/n, ?:help skip:n) :
Removes gray border of predicted face, but requires more computing resources.
2019-03-24 15:35:02 +04:00
iperov
4f4447d719 nnlib: implemented ReflectionPadding2D for plaidML,
wrapping Conv2D with new padding param
2019-03-23 22:20:05 +04:00
iperov
9849bcc1e5 fix 2019-03-21 19:04:46 +04:00
iperov
565af4d1da refactoring 2019-03-21 18:58:38 +04:00
iperov
a3df04999c removing trailing spaces 2019-03-19 23:53:27 +04:00
iperov
2b40fa182f fix 2019-03-17 23:50:18 +04:00
iperov
a71defc69a removing fail solutions 2019-03-17 23:47:14 +04:00
iperov
7aebfa3f7f added AdaBound 2019-03-17 19:17:44 +04:00
iperov
d6a45763a2 SAE: added option "Use CA weights":
Initialize network with 'Convolution Aware' weights. This may help to achieve a higher accuracy model, but consumes time at first run.
2019-03-16 12:54:36 +04:00
iperov
8da47fec13 fix ModelBase, nnlib 2019-03-13 20:53:59 +04:00
iperov
a9026ccb67 fix ModelBase, nnlib 2019-03-13 19:50:16 +04:00
iperov
58763756f5 SAE: removed simple_optimizer . Added optimizer mode for tensorflow only (NVIDIA cards), allows to train x2-x3 bigger networks with normal Adam optimizer, consuming VRAM and CPU power. 2019-03-13 11:54:17 +04:00
iperov
69174a48e0 fix DFLOptimizer 2019-03-12 16:56:59 +04:00
iperov
46ff33bf89 SAE: dssim kernel size now depends on resolution 2019-03-12 09:49:40 +04:00
iperov
fd3b9add2f SAE: added option "simple optimizer" allows to train bigger networks on same VRAM
nnlib: added DFLOptimizer is my own optimizer
2019-03-12 09:32:35 +04:00
iperov
ee8dbcbc35 revert back Adam 2019-03-11 21:52:36 +04:00
iperov
e4637336ef added ability to save optimizers states which work with K.function,
added custom Adam that can save 'iterations' param
2019-03-11 18:23:01 +04:00
iperov
9440224556 change TF console log level to 'errors only' 2019-03-09 20:23:33 +04:00
iperov
7cea93c0f2 nothing interesting 2019-02-28 20:10:58 +04:00
iperov
f0a20b46d3 SAE: added new archi 'vg' 2019-02-21 17:53:59 +04:00
iperov
d66829aae4 proper nnlib.dssim 2019-02-20 19:03:49 +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