T.Masuda commited on
Commit
436d7af
·
1 Parent(s): 70c43fc

update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -64,9 +64,6 @@ def process_image(image, enable1, left1, top1, enable2, left2, top2, enable3, le
64
  newImage.paste(maskNewImage, (0, 0), maskNewImage)
65
  yield newImage
66
 
67
- def clear(image, enable1, left1, top1, enable2, left2, top2, enable3, left3, top3, enable4, left4, top4, enable5, left5, top5, area):
68
- return [None, True, 0, 0, False, 0, 0, False, 0, 0, False, 0, 0, False, 0, 0, 'large', None]
69
-
70
  def tab_select(evt: gr.SelectData, state):
71
  if evt.target.label == 'point2':
72
  state['active'] = 1
@@ -139,7 +136,7 @@ with gr.Blocks(title='clip-image') as app:
139
  tab5.select(tab_select, inputs=state, outputs=state)
140
  image.select(image_select, inputs=[state, enable1, left1, top1, enable2, left2, top2, enable3, left3, top3, enable4, left4, top4, enable5, left5, top5], outputs=[enable1, left1, top1, enable2, left2, top2, enable3, left3, top3, enable4, left4, top4, enable5, left5, top5])
141
  btnloc.click(check_location, inputs=inputs, outputs=outputs)
142
- clearBtn.click(clear, inputs=inputs, outputs=inputs + outputs)
143
  btn.click(process_image, inputs=inputs, outputs=outputs)
144
 
145
  gr.Examples(
 
64
  newImage.paste(maskNewImage, (0, 0), maskNewImage)
65
  yield newImage
66
 
 
 
 
67
  def tab_select(evt: gr.SelectData, state):
68
  if evt.target.label == 'point2':
69
  state['active'] = 1
 
136
  tab5.select(tab_select, inputs=state, outputs=state)
137
  image.select(image_select, inputs=[state, enable1, left1, top1, enable2, left2, top2, enable3, left3, top3, enable4, left4, top4, enable5, left5, top5], outputs=[enable1, left1, top1, enable2, left2, top2, enable3, left3, top3, enable4, left4, top4, enable5, left5, top5])
138
  btnloc.click(check_location, inputs=inputs, outputs=outputs)
139
+ clearBtn.add(inputs + outputs)
140
  btn.click(process_image, inputs=inputs, outputs=outputs)
141
 
142
  gr.Examples(