mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-16 10:03:41 -07:00
fix MaskEditor, upd manual ru
This commit is contained in:
parent
7c930121e9
commit
8561c1a931
4 changed files with 137 additions and 134 deletions
Binary file not shown.
Binary file not shown.
|
@ -259,6 +259,8 @@ class InteractDesktop(InteractBase):
|
|||
cv2.imshow (wnd_name, img)
|
||||
|
||||
def on_capture_mouse (self, wnd_name):
|
||||
self.last_xy = (0,0)
|
||||
|
||||
def onMouse(event, x, y, flags, param):
|
||||
(inst, wnd_name) = param
|
||||
if event == cv2.EVENT_LBUTTONDOWN: ev = InteractBase.EVENT_LBUTTONDOWN
|
||||
|
@ -267,9 +269,12 @@ class InteractDesktop(InteractBase):
|
|||
elif event == cv2.EVENT_RBUTTONUP: ev = InteractBase.EVENT_RBUTTONUP
|
||||
elif event == cv2.EVENT_MBUTTONDOWN: ev = InteractBase.EVENT_MBUTTONDOWN
|
||||
elif event == cv2.EVENT_MBUTTONUP: ev = InteractBase.EVENT_MBUTTONUP
|
||||
elif event == cv2.EVENT_MOUSEWHEEL: ev = InteractBase.EVENT_MOUSEWHEEL
|
||||
|
||||
elif event == cv2.EVENT_MOUSEWHEEL:
|
||||
ev = InteractBase.EVENT_MOUSEWHEEL
|
||||
x,y = self.last_xy #fix opencv bug when window size more than screen size
|
||||
else: ev = 0
|
||||
|
||||
self.last_xy = (x,y)
|
||||
inst.add_mouse_event (wnd_name, x, y, ev, flags)
|
||||
cv2.setMouseCallback(wnd_name, onMouse, (self,wnd_name) )
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ class MaskEditor:
|
|||
|
||||
if self.state == self.STATE_MASKING:
|
||||
mouse_xy = self.mouse_xy.copy() + self.pwh
|
||||
|
||||
l = self.ie_polys.n_list()
|
||||
if l.n > 0:
|
||||
p = l.cur_point().copy() + self.pwh
|
||||
|
@ -438,7 +437,6 @@ def mask_editor_main(input_dir, confirmed_dir=None, skipped_dir=None):
|
|||
if jobs_count() == 0:
|
||||
for (x,y,ev,flags) in io.get_mouse_events(wnd_name):
|
||||
x, y = int (x / zoom_factor), int(y / zoom_factor)
|
||||
|
||||
ed.set_mouse_pos(x, y)
|
||||
if filepath is not None:
|
||||
if ev == io.EVENT_LBUTTONDOWN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue