mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
fix manual extractor
This commit is contained in:
parent
e5ed29bd76
commit
f56df85f78
1 changed files with 22 additions and 16 deletions
|
@ -371,6 +371,9 @@ class ExtractSubprocessor(Subprocessor):
|
||||||
self.rect_size = 100
|
self.rect_size = 100
|
||||||
self.rect_locked = False
|
self.rect_locked = False
|
||||||
self.extract_needed = True
|
self.extract_needed = True
|
||||||
|
|
||||||
|
self.image = None
|
||||||
|
self.image_filepath = None
|
||||||
|
|
||||||
io.progress_bar (None, len (self.input_data))
|
io.progress_bar (None, len (self.input_data))
|
||||||
|
|
||||||
|
@ -408,22 +411,9 @@ class ExtractSubprocessor(Subprocessor):
|
||||||
data = self.input_data[0]
|
data = self.input_data[0]
|
||||||
filepath, data_rects, data_landmarks = data.filepath, data.rects, data.landmarks
|
filepath, data_rects, data_landmarks = data.filepath, data.rects, data.landmarks
|
||||||
is_frame_done = False
|
is_frame_done = False
|
||||||
|
|
||||||
if need_remark_face: # need remark image from input data that already has a marked face?
|
if self.image_filepath != filepath:
|
||||||
need_remark_face = False
|
self.image_filepath = filepath
|
||||||
if len(data_rects) != 0: # If there was already a face then lock the rectangle to it until the mouse is clicked
|
|
||||||
self.rect = data_rects.pop()
|
|
||||||
self.landmarks = data_landmarks.pop()
|
|
||||||
data_rects.clear()
|
|
||||||
data_landmarks.clear()
|
|
||||||
|
|
||||||
self.rect_locked = True
|
|
||||||
self.rect_size = ( self.rect[2] - self.rect[0] ) / 2
|
|
||||||
self.x = ( self.rect[0] + self.rect[2] ) / 2
|
|
||||||
self.y = ( self.rect[1] + self.rect[3] ) / 2
|
|
||||||
self.redraw()
|
|
||||||
|
|
||||||
if len(data_rects) == 0:
|
|
||||||
if self.cache_original_image[0] == filepath:
|
if self.cache_original_image[0] == filepath:
|
||||||
self.original_image = self.cache_original_image[1]
|
self.original_image = self.cache_original_image[1]
|
||||||
else:
|
else:
|
||||||
|
@ -456,7 +446,23 @@ class ExtractSubprocessor(Subprocessor):
|
||||||
], (1, 1, 1) )*255).astype(np.uint8)
|
], (1, 1, 1) )*255).astype(np.uint8)
|
||||||
|
|
||||||
self.cache_text_lines_img = (sh, self.text_lines_img)
|
self.cache_text_lines_img = (sh, self.text_lines_img)
|
||||||
|
|
||||||
|
if need_remark_face: # need remark image from input data that already has a marked face?
|
||||||
|
need_remark_face = False
|
||||||
|
if len(data_rects) != 0: # If there was already a face then lock the rectangle to it until the mouse is clicked
|
||||||
|
self.rect = data_rects.pop()
|
||||||
|
self.landmarks = data_landmarks.pop()
|
||||||
|
data_rects.clear()
|
||||||
|
data_landmarks.clear()
|
||||||
|
|
||||||
|
self.rect_locked = True
|
||||||
|
self.rect_size = ( self.rect[2] - self.rect[0] ) / 2
|
||||||
|
self.x = ( self.rect[0] + self.rect[2] ) / 2
|
||||||
|
self.y = ( self.rect[1] + self.rect[3] ) / 2
|
||||||
|
self.redraw()
|
||||||
|
|
||||||
|
if len(data_rects) == 0:
|
||||||
|
(h,w,c) = self.image.shape
|
||||||
while True:
|
while True:
|
||||||
io.process_messages(0.0001)
|
io.process_messages(0.0001)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue