mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-05 20:42:11 -07:00
here new whole_face + XSeg workflow: with XSeg model you can train your own mask segmentator for dst(and/or src) faces that will be used by the merger for whole_face. Instead of using a pretrained segmentator model (which does not exist), you control which part of faces should be masked. new scripts: 5.XSeg) data_dst edit masks.bat 5.XSeg) data_src edit masks.bat 5.XSeg) train.bat Usage: unpack dst faceset if packed run 5.XSeg) data_dst edit masks.bat Read tooltips on the buttons (en/ru/zn languages are supported) mask the face using include or exclude polygon mode. repeat for 50/100 faces, !!! you don't need to mask every frame of dst only frames where the face is different significantly, for example: closed eyes changed head direction changed light the more various faces you mask, the more quality you will get Start masking from the upper left area and follow the clockwise direction. Keep the same logic of masking for all frames, for example: the same approximated jaw line of the side faces, where the jaw is not visible the same hair line Mask the obstructions using exclude polygon mode. run XSeg) train.bat train the model Check the faces of 'XSeg dst faces' preview. if some faces have wrong or glitchy mask, then repeat steps: run edit find these glitchy faces and mask them train further or restart training from scratch Restart training of XSeg model is only possible by deleting all 'model\XSeg_*' files. If you want to get the mask of the predicted face (XSeg-prd mode) in merger, you should repeat the same steps for src faceset. New mask modes available in merger for whole_face: XSeg-prd - XSeg mask of predicted face -> faces from src faceset should be labeled XSeg-dst - XSeg mask of dst face -> faces from dst faceset should be labeled XSeg-prd*XSeg-dst - the smallest area of both if workspace\model folder contains trained XSeg model, then merger will use it, otherwise you will get transparent mask by using XSeg-* modes. Some screenshots: XSegEditor: https://i.imgur.com/7Bk4RRV.jpg trainer : https://i.imgur.com/NM1Kn3s.jpg merger : https://i.imgur.com/glUzFQ8.jpg example of the fake using 13 segmented dst faces : https://i.imgur.com/wmvyizU.gifv
27 lines
983 B
Python
27 lines
983 B
Python
from .estimate_sharpness import estimate_sharpness
|
|
from .equalize_and_stack_square import equalize_and_stack_square
|
|
|
|
from .text import get_text_image, get_draw_text_lines
|
|
|
|
from .draw import draw_polygon, draw_rect
|
|
|
|
from .morph import morph_by_points
|
|
|
|
from .warp import gen_warp_params, warp_by_params
|
|
|
|
from .reduce_colors import reduce_colors
|
|
|
|
from .color_transfer import color_transfer, color_transfer_mix, color_transfer_sot, color_transfer_mkl, color_transfer_idt, color_hist_match, reinhard_color_transfer, linear_color_transfer, seamless_clone
|
|
|
|
from .common import normalize_channels, cut_odd_image, overlay_alpha_image
|
|
|
|
from .IEPolys import IEPolys
|
|
from .SegIEPolys import *
|
|
|
|
from .blursharpen import LinearMotionBlur, blursharpen
|
|
|
|
from .filters import apply_random_rgb_levels, \
|
|
apply_random_hsv_shift, \
|
|
apply_random_motion_blur, \
|
|
apply_random_gaussian_blur, \
|
|
apply_random_bilinear_resize
|