freealise commited on
Commit
4dfaa8f
·
verified ·
1 Parent(s): 3f0d02c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -553,6 +553,7 @@ def draw_mask(o, b, v, d, evt: gr.EventData):
553
  frame[mask>0] = (255,255,255)
554
  cv2.imwrite(frames[frame_selected], frame)
555
 
 
556
  return gr.ImageEditor(value=d)
557
 
558
 
@@ -814,6 +815,11 @@ if (document.getElementById("image_edit") && document.getElementById("image_edit
814
  var evt = document.createEvent("Event");
815
  evt.initEvent("input", true, false);
816
  document.getElementById("mouse").getElementsByTagName("textarea")[0].dispatchEvent(evt);
 
 
 
 
 
817
  document.getElementById("mouse").getElementsByTagName("textarea")[0].value = "[]";
818
  }
819
  clearInterval(intv_);
 
553
  frame[mask>0] = (255,255,255)
554
  cv2.imwrite(frames[frame_selected], frame)
555
 
556
+ switch_rows(False)
557
  return gr.ImageEditor(value=d)
558
 
559
 
 
815
  var evt = document.createEvent("Event");
816
  evt.initEvent("input", true, false);
817
  document.getElementById("mouse").getElementsByTagName("textarea")[0].dispatchEvent(evt);
818
+ }
819
+ document.getElementById("image_edit").getElementsByTagName("canvas")[0].onfocus = function(e) {
820
+ document.getElementById("mouse").getElementsByTagName("textarea")[0].value = "[]";
821
+ }
822
+ document.getElementById("image_edit").getElementsByTagName("canvas")[0].onblur = function(e) {
823
  document.getElementById("mouse").getElementsByTagName("textarea")[0].value = "[]";
824
  }
825
  clearInterval(intv_);