Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -317,34 +317,23 @@ with gr.Blocks(css= "style.css") as app:
|
|
317 |
|
318 |
# Tab untuk Describe
|
319 |
with gr.Tab("Describe"):
|
320 |
-
# Components
|
321 |
-
image = gr.Image(type="pil", image_mode="RGBA", label="Input")
|
322 |
-
model_repo = gr.Dropdown(dropdown_list, value=SWINV2_MODEL_DSV3_REPO, label="Model")
|
323 |
-
general_thresh = gr.Slider(0, 1, step=args.score_slider_step, value=args.score_general_threshold, label="General Tags Threshold", scale=3)
|
324 |
-
general_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
|
325 |
-
character_thresh = gr.Slider(0, 1, step=args.score_slider_step, value=args.score_character_threshold, label="Character Tags Threshold", scale=3)
|
326 |
-
character_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
|
327 |
-
clear_button = gr.ClearButton(components=[image, model_repo, general_thresh, general_mcut_enabled, character_thresh, character_mcut_enabled], variant="secondary", size="lg")
|
328 |
-
submit_button = gr.Button(value="Submit", variant="primary", size="lg")
|
329 |
-
sorted_general_strings = gr.Textbox(label="Output (string)")
|
330 |
-
rating = gr.Label(label="Rating")
|
331 |
-
character_res = gr.Label(label="Output (characters)")
|
332 |
-
general_res = gr.Label(label="Output (tags)")
|
333 |
-
# Layout
|
334 |
with gr.Row():
|
335 |
-
with gr.Column(
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
348 |
clear_button.add([sorted_general_strings, rating, character_res, general_res])
|
349 |
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])
|
350 |
|
|
|
317 |
|
318 |
# Tab untuk Describe
|
319 |
with gr.Tab("Describe"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
with gr.Row():
|
321 |
+
with gr.Column():
|
322 |
+
# Components
|
323 |
+
image = gr.Image(type="pil", image_mode="RGBA", label="Input")
|
324 |
+
model_repo = gr.Dropdown(dropdown_list, value=SWINV2_MODEL_DSV3_REPO, label="Model")
|
325 |
+
general_thresh = gr.Slider(0, 1, step=args.score_slider_step, value=args.score_general_threshold, label="General Tags Threshold", scale=3)
|
326 |
+
general_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
|
327 |
+
character_thresh = gr.Slider(0, 1, step=args.score_slider_step, value=args.score_character_threshold, label="Character Tags Threshold", scale=3)
|
328 |
+
character_mcut_enabled = gr.Checkbox(value=False, label="Use MCut threshold", scale=1)
|
329 |
+
clear_button = gr.ClearButton(components=[image, model_repo, general_thresh, general_mcut_enabled, character_thresh, character_mcut_enabled], variant="secondary", size="lg")
|
330 |
+
submit_button = gr.Button(value="Submit", variant="primary", size="lg")
|
331 |
+
with gr.Column():
|
332 |
+
sorted_general_strings = gr.Textbox(label="Output (string)")
|
333 |
+
rating = gr.Label(label="Rating")
|
334 |
+
character_res = gr.Label(label="Output (characters)")
|
335 |
+
general_res = gr.Label(label="Output (tags)")
|
336 |
+
|
337 |
clear_button.add([sorted_general_strings, rating, character_res, general_res])
|
338 |
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])
|
339 |
|