mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 05:22:06 -07:00
Restore mask functionality in mask editor (#442)
* Restore mask functionality Once mask is saved (using 'c'), mask tool can apply same modifications to the next alignment (by pressing 'r'). Thus some routine work is decreased. * Mask edit added function to re-apply changes
This commit is contained in:
parent
24eac44dd9
commit
d26ac4896e
1 changed files with 9 additions and 2 deletions
|
@ -351,7 +351,7 @@ def mask_editor_main(input_dir, confirmed_dir=None, skipped_dir=None, no_default
|
||||||
done_paths = []
|
done_paths = []
|
||||||
done_images_types = {}
|
done_images_types = {}
|
||||||
image_paths_total = len(image_paths)
|
image_paths_total = len(image_paths)
|
||||||
|
saved_ie_polys = IEPolys()
|
||||||
zoom_factor = 1.0
|
zoom_factor = 1.0
|
||||||
preview_images_count = 9
|
preview_images_count = 9
|
||||||
target_wh = 256
|
target_wh = 256
|
||||||
|
@ -427,6 +427,7 @@ def mask_editor_main(input_dir, confirmed_dir=None, skipped_dir=None, no_default
|
||||||
'[Right mouse button] - mark exclude mask.',
|
'[Right mouse button] - mark exclude mask.',
|
||||||
'[Middle mouse button] - finish current poly.',
|
'[Middle mouse button] - finish current poly.',
|
||||||
'[Mouse wheel] - undo/redo poly or point. [+ctrl] - undo to begin/redo to end',
|
'[Mouse wheel] - undo/redo poly or point. [+ctrl] - undo to begin/redo to end',
|
||||||
|
'[r] - applies edits made to last saved image.',
|
||||||
'[q] - prev image. [w] - skip and move to %s. [e] - save and move to %s. ' % (skipped_path.name, confirmed_path.name),
|
'[q] - prev image. [w] - skip and move to %s. [e] - save and move to %s. ' % (skipped_path.name, confirmed_path.name),
|
||||||
'[z] - prev image. [x] - skip. [c] - save. ',
|
'[z] - prev image. [x] - skip. [c] - save. ',
|
||||||
'hold [shift] - speed up the frame counter by 10.',
|
'hold [shift] - speed up the frame counter by 10.',
|
||||||
|
@ -486,11 +487,17 @@ def mask_editor_main(input_dir, confirmed_dir=None, skipped_dir=None, no_default
|
||||||
if chr_key == 'e':
|
if chr_key == 'e':
|
||||||
do_save_move_count = 1 if not shift_pressed else 10
|
do_save_move_count = 1 if not shift_pressed else 10
|
||||||
elif chr_key == 'c':
|
elif chr_key == 'c':
|
||||||
|
saved_ie_polys = ed.ie_polys
|
||||||
do_save_count = 1 if not shift_pressed else 10
|
do_save_count = 1 if not shift_pressed else 10
|
||||||
elif chr_key == 'w':
|
elif chr_key == 'w':
|
||||||
do_skip_move_count = 1 if not shift_pressed else 10
|
do_skip_move_count = 1 if not shift_pressed else 10
|
||||||
elif chr_key == 'x':
|
elif chr_key == 'x':
|
||||||
do_skip_count = 1 if not shift_pressed else 10
|
do_skip_count = 1 if not shift_pressed else 10
|
||||||
|
elif chr_key == 'r' and saved_ie_polys != None:
|
||||||
|
ed.state = 0
|
||||||
|
ed.ie_polys = saved_ie_polys
|
||||||
|
ed.redo_to_end_point()
|
||||||
|
ed.mask_finish()
|
||||||
|
|
||||||
if do_prev_count > 0:
|
if do_prev_count > 0:
|
||||||
do_prev_count -= 1
|
do_prev_count -= 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue