Commit graph

50 commits

Author SHA1 Message Date
Colombo
302d23a612 refactoring 2020-03-03 22:20:15 +04:00
Colombo
757ec77e44 refactoring 2020-03-01 19:09:50 +04:00
Colombo
acb0b34811 revert 2020-02-27 12:03:01 +04:00
Colombo
9860a38907 upd SampleGenerator 2020-02-27 09:58:46 +04:00
Colombo
f1d115b63b added experimental face type 'whole_face'
Basic usage instruction: https://i.imgur.com/w7LkId2.jpg

	'whole_face' requires skill in Adobe After Effects.

	For using whole_face you have to extract whole_face's by using
	4) data_src extract whole_face
	and
	5) data_dst extract whole_face
	Images will be extracted in 512 resolution, so they can be used for regular full_face's and half_face's.

	'whole_face' covers whole area of face include forehead in training square,
	but training mask is still 'full_face'
	therefore it requires manual final masking and composing in Adobe After Effects.

added option 'masked_training'
	This option is available only for 'whole_face' type.
	Default is ON.
	Masked training clips training area to full_face mask,
	thus network will train the faces properly.
	When the face is trained enough, disable this option to train all area of the frame.
	Merge with 'raw-rgb' mode, then use Adobe After Effects to manually mask, tune color, and compose whole face include forehead.
2020-02-21 16:21:04 +04:00
Colombo
e6e11ca056 SampleProcessor : added unused random rgb levels 2020-02-20 08:30:53 +04:00
Colombo
5d5718704d fix SampleProcessor 2020-02-19 07:00:46 +04:00
Colombo
9598ba0141 SAEHD:
added option Eyes priority (y/n)

	fix eye problems during training  ( especially on HD architectures )
	by forcing the neural network to train eyes with higher priority
	before/after https://i.imgur.com/YQHOuSR.jpg

	It does not guarantee the right eye direction.
2020-02-18 14:30:07 +04:00
Colombo
60cc917350 add eye masking code 2020-02-03 06:38:58 +04:00
Colombo
5620763ccf "Enable autobackup" option is replaced by
"Autobackup every N hour" 0..24 (default 0 disabled), Autobackup model files with preview every N hour
2020-02-02 20:53:18 +04:00
Colombo
9fd49ee3f0 removed use_float16 option
fix multigpu training
2020-01-30 07:35:33 +04:00
Colombo
5fe5fa131c SampleProcessor.py : refactoring and gen mask struct 2020-01-29 18:08:54 +04:00
Colombo
7386a9d6fd optimized face sample generator, CPU load is significantly reduced
SAEHD:

added new option
GAN power 0.0 .. 10.0
	Train the network in Generative Adversarial manner.
	Forces the neural network to learn small details of the face.
	You can enable/disable this option at any time,
	but better to enable it when the network is trained enough.
	Typical value is 1.0
	GAN power with pretrain mode will not work.

Example of enabling GAN on 81k iters +5k iters
https://i.imgur.com/OdXHLhU.jpg
https://i.imgur.com/CYAJmJx.jpg

dfhd: default Decoder dimensions are now 48
the preview for 256 res is now correctly displayed

fixed model naming/renaming/removing

Improvements for those involved in post-processing in AfterEffects:

Codec is reverted back to x264 in order to properly use in AfterEffects and video players.

Merger now always outputs the mask to workspace\data_dst\merged_mask

removed raw modes except raw-rgb
raw-rgb mode now outputs selected face mask_mode (before square mask)

'export alpha mask' button is replaced by 'show alpha mask'.
You can view the alpha mask without recompute the frames.

8) 'merged *.bat' now also output 'result_mask.' video file.
8) 'merged lossless' now uses x264 lossless codec (before PNG codec)
result_mask video file is always lossless.

Thus you can use result_mask video file as mask layer in the AfterEffects.
2020-01-28 12:24:45 +04:00
Colombo
76ca79216e Upgraded to TF version 1.13.2
Removed the wait at first launch for most graphics cards.

Increased speed of training by 10-20%, but you have to retrain all models from scratch.

SAEHD:

added option 'use float16'
	Experimental option. Reduces the model size by half.
	Increases the speed of training.
	Decreases the accuracy of the model.
	The model may collapse or not train.
	Model may not learn the mask in large resolutions.

true_face_training option is replaced by
"True face power". 0.0000 .. 1.0
Experimental option. Discriminates the result face to be more like the src face. Higher value - stronger discrimination.
Comparison - https://i.imgur.com/czScS9q.png
2020-01-25 21:58:19 +04:00
Colombo
38b85108b3 DFL-2.0 initial branch commit 2020-01-21 18:43:39 +04:00
Colombo
e0e8970ab9 fix PackedFaceset 2019-12-22 15:58:46 +04:00
Colombo
64021b9c62 more stable and precise version of face transformation matrix.
fixed bleeding mask on some samples
2019-12-20 10:30:49 +04:00
Colombo
068c7d0d55 temporary revert last fixes 2019-12-20 10:21:59 +04:00
Colombo
dd1d5e8909 improved face align,
More stable and precise version of the face transformation matrix.
Now full_faces are aligned with the upper and lateral boundaries of the frame,
result: fix of cutted mouth, increase area of the cheeks of side faces
before/after https://i.imgur.com/t9IyGZv.jpg
therefore, additional training is required for existing models.
Optionally, you can re-extract dst faces of your project, if they have problems with cutted mouth or cheeks.
2019-12-19 18:33:04 +04:00
Colombo
e8673e3fcc nothing interesting 2019-12-11 22:33:23 +04:00
Colombo
668513a507 1 2019-11-16 16:54:10 +04:00
Colombo
c0f258c336 SAE,SAEHD,Converter:
added sot-m color transfer

Converter:
removed seamless2 mode
2019-11-12 09:07:50 +04:00
Colombo
73511a072a SAE/SAEHD:
removed option 'apply random ct'

added option
   Color transfer mode apply to src faceset. ( none/rct/lct/mkl/idt, ?:help skip: none )
   Change color distribution of src samples close to dst samples. Try all modes to find the best.
before was lct mode, but sometime it does not work properly for some facesets.
2019-10-15 11:22:19 +04:00
Colombo
e013cb0f6b moving some files 2019-10-14 09:34:44 +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
d2d0dcb5e7 fix multigpu extractor 2019-10-10 13:01:57 +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
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
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
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
22efba57a3 fix 2019-05-11 19:44:01 +04:00
iperov
1493551410 fix 2019-05-11 19:42:03 +04:00
iperov
53c4f8a86e cleaning 2019-05-11 16:55:06 +04:00
iperov
e8f207557b fix bgr_shuffle 2019-05-10 08:11:17 +04:00
iperov
5a9498543d refactoring 2019-05-09 18:05:50 +04:00
iperov
d003366033 cleaning 2019-05-07 10:47:51 +04:00
iperov
809cc14860 fix 2019-05-06 16:27:18 +04:00
iperov
a805f81142 SAE: added test option: 'Apply random color transfer to src faceset' 2019-05-06 11:34:56 +04:00
iperov
f89200d236 nothing interesting 2019-04-26 15:18:48 +04:00
iperov
0e088f6415 _ 2019-04-25 14:46:39 +04:00
iperov
947feac047 refactorings 2019-04-24 11:28:58 +04:00
iperov
2809d495c2 _ 2019-04-23 17:31:58 +04:00
iperov
8969e80275 _ 2019-04-23 14:07:38 +04:00
iperov
e58197ca22 initial code to extract umdfaces.io dataset and train pose estimator 2019-04-23 08:14:09 +04:00
iperov
242b850245 fix bgr_shuffle randomizer 2019-04-20 18:05:11 +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
58d7e990f4 refactorings, added motion blur to SampleProcessor for FANSegmentator trainer 2019-04-07 23:08:00 +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
3cf3bb786e rename samples to samplelib 2019-03-27 10:44:13 +04:00
Renamed from samples/SampleProcessor.py (Browse further)