DamarJati commited on
Commit
168d548
·
verified ·
1 Parent(s): 2a651a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -165,10 +165,10 @@ with gr.Blocks(css= "style.css") as app:
165
  # Components
166
  image = gr.Image(type="pil", image_mode="RGBA", label="Input")
167
  submit_button = gr.Button(value="Submit", variant="primary", size="lg")
168
- model_repo = gr.Dropdown(dropdown_list, value=SWINV2_MODEL_DSV3_REPO, label="Model")
169
- general_thresh = gr.Slider(0, 1, step=args.score_slider_step, value=args.score_general_threshold, label="General Tags Threshold", scale=3)
170
  general_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
171
- character_thresh = gr.Slider(0, 1, step=args.score_slider_step, value=args.score_character_threshold, label="Character Tags Threshold", scale=3)
172
  character_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
173
  clear_button = gr.ClearButton(components=[image, model_repo, general_thresh, general_mcut_enabled, character_thresh, character_mcut_enabled], variant="secondary", size="lg")
174
 
@@ -179,7 +179,7 @@ with gr.Blocks(css= "style.css") as app:
179
  general_res = gr.Label(label="Output (tags)")
180
 
181
  clear_button.add([sorted_general_strings, rating, character_res, general_res])
182
- submit_button.click(predictor.predict, inputs=[image, model_repo, general_thresh, general_mcut_enabled, character_thresh, character_mcut_enabled], outputs=[sorted_general_strings, rating, character_res, general_res])
183
 
184
  # Jalankan antarmuka
185
  app.launch()
 
165
  # Components
166
  image = gr.Image(type="pil", image_mode="RGBA", label="Input")
167
  submit_button = gr.Button(value="Submit", variant="primary", size="lg")
168
+ model_repo = gr.Dropdown(modules.wdtagger.dropdown_list, value=modules.wdtagger.dropdown_list[0], label="Model")
169
+ general_thresh = gr.Slider(0, 1, step=modules.wdtagger.args.score_slider_step, value=args.score_general_threshold, label="General Tags Threshold", scale=3)
170
  general_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
171
+ character_thresh = gr.Slider(0, 1, step=modules.wdtagger.args.score_slider_step, value=args.score_character_threshold, label="Character Tags Threshold", scale=3)
172
  character_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
173
  clear_button = gr.ClearButton(components=[image, model_repo, general_thresh, general_mcut_enabled, character_thresh, character_mcut_enabled], variant="secondary", size="lg")
174
 
 
179
  general_res = gr.Label(label="Output (tags)")
180
 
181
  clear_button.add([sorted_general_strings, rating, character_res, general_res])
182
+ submit_button.click(modules.wdtagger.predictor.predict, inputs=[image, model_repo, general_thresh, general_mcut_enabled, character_thresh, character_mcut_enabled], outputs=[sorted_general_strings, rating, character_res, general_res])
183
 
184
  # Jalankan antarmuka
185
  app.launch()