freealise commited on
Commit
e2c87e5
1 Parent(s): d1fd699

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -335,6 +335,10 @@ def switch_rows(v):
335
  print(frames[0])
336
  return frames
337
 
 
 
 
 
338
 
339
  css = """
340
  #img-display-container {
@@ -385,6 +389,8 @@ with gr.Blocks(css=css) as demo:
385
  output_switch = gr.Checkbox(label="Show depths")
386
  output_switch.input(fn=switch_rows, inputs=[output_switch], outputs=[output_frame])
387
  output_mask = gr.ImageEditor(layers=False, sources=None, type="numpy", interactive=True, transforms=(None,), eraser=gr.Eraser(), brush=gr.Brush(colors=['black', 'darkgray', 'gray', 'lightgray', 'white']))
 
 
388
  submit = gr.Button("Submit")
389
  with gr.Column():
390
  model_type = gr.Dropdown([("small", "vits"), ("base", "vitb"), ("large", "vitl")], type="value", value="vits", label='Model Type')
 
335
  print(frames[0])
336
  return frames
337
 
338
+ def draw_mask(v, evt: gr.EventData):
339
+ print(evt)
340
+ return v
341
+
342
 
343
  css = """
344
  #img-display-container {
 
389
  output_switch = gr.Checkbox(label="Show depths")
390
  output_switch.input(fn=switch_rows, inputs=[output_switch], outputs=[output_frame])
391
  output_mask = gr.ImageEditor(layers=False, sources=None, type="numpy", interactive=True, transforms=(None,), eraser=gr.Eraser(), brush=gr.Brush(colors=['black', 'darkgray', 'gray', 'lightgray', 'white']))
392
+ output_mask.input(fn=draw_mask, inputs=[output_mask], outputs=[output_mask])
393
+ output_mask.apply(fn=draw_mask, inputs=[output_mask], outputs=[output_mask])
394
  submit = gr.Button("Submit")
395
  with gr.Column():
396
  model_type = gr.Dropdown([("small", "vits"), ("base", "vitb"), ("large", "vitl")], type="value", value="vits", label='Model Type')