Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -940,9 +940,9 @@ def inference(mode,image_uploader,file_uploader):
|
|
| 940 |
return styled_ko_deplot_table, styled_aihub_deplot_table, styled_unichart_table,ko_deplot_label_table,aihub_deplot_label_table,unichart_label_table,ko_deplot_score_table, aihub_deplot_score_table, unichart_score_table
|
| 941 |
def interface_selector(selector):
|
| 942 |
if selector == "์ด๋ฏธ์ง ์
๋ก๋":
|
| 943 |
-
return gr.update(visible=True),gr.update(visible=False),gr.State("image_upload"),gr.update(visible=False),gr.update(visible=False)
|
| 944 |
elif selector == "ํ์ผ ์
๋ก๋":
|
| 945 |
-
return gr.update(visible=False),gr.update(visible=True),gr.State("file_upload"), gr.update(visible=True),gr.update(visible=True)
|
| 946 |
|
| 947 |
def file_selector(selector):
|
| 948 |
if selector == "low score ์ฐจํธ":
|
|
@@ -1065,7 +1065,6 @@ with gr.Blocks(css=css) as iface:
|
|
| 1065 |
# global image_uploader,file_uploader
|
| 1066 |
image_uploader= gr.File(file_count="single",file_types=["image"],visible=True)
|
| 1067 |
file_uploader= gr.File(file_count="single", file_types=[".txt"], visible=False)
|
| 1068 |
-
file_uploader=gr.File("./new_top_20_percent_images.txt")
|
| 1069 |
file_upload_option=gr.Radio(choices=["low score ์ฐจํธ","high score ์ฐจํธ"],label="ํ์ผ ์
๋ก๋ ์ต์
",visible=False)
|
| 1070 |
chart_type = gr.Dropdown(["์ผ๋ฐ ๊ฐ๋ก ๋ง๋ํ","๋์ ๊ฐ๋ก ๋ง๋ํ","100% ๊ธฐ์ค ๋์ ๊ฐ๋ก ๋ง๋ํ", "์ผ๋ฐ ์ธ๋ก ๋ง๋ํ","๋์ ์ธ๋ก ๋ง๋ํ","100% ๊ธฐ์ค ๋์ ์ธ๋ก ๋ง๋ํ","์ ํ", "์ํ", "๊ธฐํ ๋ฐฉ์ฌํ", "๊ธฐํ ํผํฉํ", "์ ์ฒด"], label="Chart Type", value="all")
|
| 1071 |
model_type=gr.Dropdown(["vaiv_deplot","unichart","all"],label="model",multiselect=True)
|
|
@@ -1098,7 +1097,7 @@ with gr.Blocks(css=css) as iface:
|
|
| 1098 |
upload_option.change(
|
| 1099 |
interface_selector,
|
| 1100 |
inputs=[upload_option],
|
| 1101 |
-
outputs=[image_uploader, file_uploader, mode, image_name,file_upload_option]
|
| 1102 |
)
|
| 1103 |
|
| 1104 |
file_upload_option.change(
|
|
|
|
| 940 |
return styled_ko_deplot_table, styled_aihub_deplot_table, styled_unichart_table,ko_deplot_label_table,aihub_deplot_label_table,unichart_label_table,ko_deplot_score_table, aihub_deplot_score_table, unichart_score_table
|
| 941 |
def interface_selector(selector):
|
| 942 |
if selector == "์ด๋ฏธ์ง ์
๋ก๋":
|
| 943 |
+
return gr.update(visible=True),gr.update(visible=False),gr.State("image_upload"),gr.update(visible=False),gr.update(visible=False),gr.File("./new_top_20_percent_images.txt"),"high score ์ฐจํธ"
|
| 944 |
elif selector == "ํ์ผ ์
๋ก๋":
|
| 945 |
+
return gr.update(visible=False),gr.update(visible=True),gr.State("file_upload"), gr.update(visible=True),gr.update(visible=True),gr.File("./new_top_20_percent_images.txt"),"high score ์ฐจํธ"
|
| 946 |
|
| 947 |
def file_selector(selector):
|
| 948 |
if selector == "low score ์ฐจํธ":
|
|
|
|
| 1065 |
# global image_uploader,file_uploader
|
| 1066 |
image_uploader= gr.File(file_count="single",file_types=["image"],visible=True)
|
| 1067 |
file_uploader= gr.File(file_count="single", file_types=[".txt"], visible=False)
|
|
|
|
| 1068 |
file_upload_option=gr.Radio(choices=["low score ์ฐจํธ","high score ์ฐจํธ"],label="ํ์ผ ์
๋ก๋ ์ต์
",visible=False)
|
| 1069 |
chart_type = gr.Dropdown(["์ผ๋ฐ ๊ฐ๋ก ๋ง๋ํ","๋์ ๊ฐ๋ก ๋ง๋ํ","100% ๊ธฐ์ค ๋์ ๊ฐ๋ก ๋ง๋ํ", "์ผ๋ฐ ์ธ๋ก ๋ง๋ํ","๋์ ์ธ๋ก ๋ง๋ํ","100% ๊ธฐ์ค ๋์ ์ธ๋ก ๋ง๋ํ","์ ํ", "์ํ", "๊ธฐํ ๋ฐฉ์ฌํ", "๊ธฐํ ํผํฉํ", "์ ์ฒด"], label="Chart Type", value="all")
|
| 1070 |
model_type=gr.Dropdown(["vaiv_deplot","unichart","all"],label="model",multiselect=True)
|
|
|
|
| 1097 |
upload_option.change(
|
| 1098 |
interface_selector,
|
| 1099 |
inputs=[upload_option],
|
| 1100 |
+
outputs=[image_uploader, file_uploader, mode, image_name,file_upload_option,file_uploader,file_upload_option]
|
| 1101 |
)
|
| 1102 |
|
| 1103 |
file_upload_option.change(
|