Joker1212 commited on
Commit
f32bb3e
·
1 Parent(s): 3b81b76

fix: add binarize_model

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -21,12 +21,14 @@ tasks = {
21
  "unblur": ["OpenCvBilateral", "NAFDPM", None]
22
  }
23
 
24
- def process_image(img_path, unwrap_model, unshadow_model, unblur_model):
25
  task_list = []
26
  if unwrap_model:
27
  task_list.append(("unwrap", unwrap_model))
28
  if unshadow_model:
29
  task_list.append(("unshadow", unshadow_model))
 
 
30
  if unblur_model:
31
  task_list.append(("unblur", unblur_model))
32
 
@@ -78,6 +80,7 @@ def main():
78
 
79
  unwrap_dropdown = gr.Dropdown(label="Select Unwrap Model", choices=tasks["unwrap"], value="UVDoc")
80
  unshadow_dropdown = gr.Dropdown(label="Select Unshadow Model", choices=tasks["unshadow"], value="GCDnet")
 
81
  unblur_dropdown = gr.Dropdown(label="Select Unblur Model", choices=tasks["unblur"], value="OpenCvBilateral")
82
 
83
  run_button = gr.Button("summit")
@@ -86,7 +89,7 @@ def main():
86
  output_image = gr.Image(label="output")
87
  elapse_textbox = gr.Textbox(label="Elapsed Time", interactive=False)
88
  # 绑定按钮点击事件
89
- run_button.click(fn=process_image, inputs=[img_input, unwrap_dropdown, unshadow_dropdown, unblur_dropdown],outputs=[output_image, elapse_textbox])
90
 
91
  # 启动应用
92
  demo.launch()
 
21
  "unblur": ["OpenCvBilateral", "NAFDPM", None]
22
  }
23
 
24
+ def process_image(img_path, unwrap_model, unshadow_model, binarize_model, unblur_model):
25
  task_list = []
26
  if unwrap_model:
27
  task_list.append(("unwrap", unwrap_model))
28
  if unshadow_model:
29
  task_list.append(("unshadow", unshadow_model))
30
+ if binarize_model:
31
+ task_list.append(("binarize", binarize_model))
32
  if unblur_model:
33
  task_list.append(("unblur", unblur_model))
34
 
 
80
 
81
  unwrap_dropdown = gr.Dropdown(label="Select Unwrap Model", choices=tasks["unwrap"], value="UVDoc")
82
  unshadow_dropdown = gr.Dropdown(label="Select Unshadow Model", choices=tasks["unshadow"], value="GCDnet")
83
+ binarize_dropdown = gr.Dropdown(label="Select Unshadow Model", choices=tasks["binarize"], value=None)
84
  unblur_dropdown = gr.Dropdown(label="Select Unblur Model", choices=tasks["unblur"], value="OpenCvBilateral")
85
 
86
  run_button = gr.Button("summit")
 
89
  output_image = gr.Image(label="output")
90
  elapse_textbox = gr.Textbox(label="Elapsed Time", interactive=False)
91
  # 绑定按钮点击事件
92
+ run_button.click(fn=process_image, inputs=[img_input, unwrap_dropdown, unshadow_dropdown, binarize_dropdown, unblur_dropdown],outputs=[output_image, elapse_textbox])
93
 
94
  # 启动应用
95
  demo.launch()