Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -970,19 +970,24 @@ def update_results(selected_models):
|
|
970 |
visibility[0] = True # ko_deplot_generated_table
|
971 |
visibility[1] = True # ko_deplot_score_table
|
972 |
visibility[6] = True # ko_deplot_label_table
|
973 |
-
|
974 |
if "aihub_deplot" in selected_models:
|
975 |
visibility[2] = True # aihub_deplot_generated_table
|
976 |
visibility[3] = True # aihub_deplot_score_table
|
977 |
visibility[7] = True # aihub_deplot_label_table
|
978 |
-
|
979 |
if "unichart" in selected_models:
|
980 |
visibility[4] = True # unichart_generated_table
|
981 |
visibility[5] = True # unichart_score_table
|
982 |
visibility[8] = True # unichart_label_table
|
983 |
|
984 |
if "all" in selected_models:
|
985 |
-
visibility=
|
|
|
|
|
|
|
|
|
|
|
986 |
|
987 |
# Return gr.update for each component with the corresponding visibility status
|
988 |
return tuple(gr.update(visible=v) for v in visibility)
|
@@ -1060,9 +1065,10 @@ with gr.Blocks(css=css) as iface:
|
|
1060 |
# global image_uploader,file_uploader
|
1061 |
image_uploader= gr.File(file_count="single",file_types=["image"],visible=True)
|
1062 |
file_uploader= gr.File(file_count="single", file_types=[".txt"], visible=False)
|
|
|
1063 |
file_upload_option=gr.Radio(choices=["low score ์ฐจํธ","high score ์ฐจํธ"],label="ํ์ผ ์
๋ก๋ ์ต์
",visible=False)
|
1064 |
chart_type = gr.Dropdown(["์ผ๋ฐ ๊ฐ๋ก ๋ง๋ํ","๋์ ๊ฐ๋ก ๋ง๋ํ","100% ๊ธฐ์ค ๋์ ๊ฐ๋ก ๋ง๋ํ", "์ผ๋ฐ ์ธ๋ก ๋ง๋ํ","๋์ ์ธ๋ก ๋ง๋ํ","100% ๊ธฐ์ค ๋์ ์ธ๋ก ๋ง๋ํ","์ ํ", "์ํ", "๊ธฐํ ๋ฐฉ์ฌํ", "๊ธฐํ ํผํฉํ", "์ ์ฒด"], label="Chart Type", value="all")
|
1065 |
-
model_type=gr.Dropdown(["
|
1066 |
image_displayer=gr.Image(visible=True)
|
1067 |
with gr.Row():
|
1068 |
pre_button=gr.Button("์ด์ ",interactive="False")
|
@@ -1072,15 +1078,15 @@ with gr.Blocks(css=css) as iface:
|
|
1072 |
#file_button.click(interface_selector, inputs=gr.State("ํ์ผ ์
๋ก๋"), outputs=[image_uploader, file_uploader,mode,mode_label,image_name])
|
1073 |
inference_button=gr.Button("์ถ๋ก ")
|
1074 |
with gr.Column():
|
1075 |
-
ko_deplot_generated_table=gr.DataFrame(visible=False,label="
|
1076 |
aihub_deplot_generated_table=gr.DataFrame(visible=False,label="aihub-deplot ์ถ๋ก ๊ฒฐ๊ณผ",elem_classes="dataframe-class")
|
1077 |
unichart_generated_table=gr.DataFrame(visible=False,label="unichart ์ถ๋ก ๊ฒฐ๊ณผ",elem_classes="dataframe-class")
|
1078 |
with gr.Column():
|
1079 |
-
ko_deplot_label_table=gr.DataFrame(visible=False,label="
|
1080 |
aihub_deplot_label_table=gr.DataFrame(visible=False,label="aihub-deplot ์ ๋ตํ
์ด๋ธ",elem_classes="dataframe-class")
|
1081 |
unichart_label_table=gr.DataFrame(visible=False,label="unichart ์ ๋ตํ
์ด๋ธ",elem_classes="dataframe-class")
|
1082 |
with gr.Column():
|
1083 |
-
ko_deplot_score_table=gr.DataFrame(visible=False,label="
|
1084 |
aihub_deplot_score_table=gr.DataFrame(visible=False,label="aihub_deplot ์ ์",elem_classes="dataframe-class")
|
1085 |
unichart_score_table=gr.DataFrame(visible=False,label="unichart ์ ์",elem_classes="dataframe-class")
|
1086 |
model_type.change(
|
|
|
970 |
visibility[0] = True # ko_deplot_generated_table
|
971 |
visibility[1] = True # ko_deplot_score_table
|
972 |
visibility[6] = True # ko_deplot_label_table
|
973 |
+
'''
|
974 |
if "aihub_deplot" in selected_models:
|
975 |
visibility[2] = True # aihub_deplot_generated_table
|
976 |
visibility[3] = True # aihub_deplot_score_table
|
977 |
visibility[7] = True # aihub_deplot_label_table
|
978 |
+
'''
|
979 |
if "unichart" in selected_models:
|
980 |
visibility[4] = True # unichart_generated_table
|
981 |
visibility[5] = True # unichart_score_table
|
982 |
visibility[8] = True # unichart_label_table
|
983 |
|
984 |
if "all" in selected_models:
|
985 |
+
visibility[0] = True # ko_deplot_generated_table
|
986 |
+
visibility[1] = True # ko_deplot_score_table
|
987 |
+
visibility[6] = True # ko_deplot_label_table
|
988 |
+
visibility[4] = True # unichart_generated_table
|
989 |
+
visibility[5] = True # unichart_score_table
|
990 |
+
visibility[8] = True # unichart_label_table
|
991 |
|
992 |
# Return gr.update for each component with the corresponding visibility status
|
993 |
return tuple(gr.update(visible=v) for v in visibility)
|
|
|
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)
|
1072 |
image_displayer=gr.Image(visible=True)
|
1073 |
with gr.Row():
|
1074 |
pre_button=gr.Button("์ด์ ",interactive="False")
|
|
|
1078 |
#file_button.click(interface_selector, inputs=gr.State("ํ์ผ ์
๋ก๋"), outputs=[image_uploader, file_uploader,mode,mode_label,image_name])
|
1079 |
inference_button=gr.Button("์ถ๋ก ")
|
1080 |
with gr.Column():
|
1081 |
+
ko_deplot_generated_table=gr.DataFrame(visible=False,label="vaiv-deplot ์ถ๋ก ๊ฒฐ๊ณผ",elem_classes="dataframe-class")
|
1082 |
aihub_deplot_generated_table=gr.DataFrame(visible=False,label="aihub-deplot ์ถ๋ก ๊ฒฐ๊ณผ",elem_classes="dataframe-class")
|
1083 |
unichart_generated_table=gr.DataFrame(visible=False,label="unichart ์ถ๋ก ๊ฒฐ๊ณผ",elem_classes="dataframe-class")
|
1084 |
with gr.Column():
|
1085 |
+
ko_deplot_label_table=gr.DataFrame(visible=False,label="vaiv-deplot ์ ๋ตํ
์ด๋ธ",elem_classes="dataframe-class")
|
1086 |
aihub_deplot_label_table=gr.DataFrame(visible=False,label="aihub-deplot ์ ๋ตํ
์ด๋ธ",elem_classes="dataframe-class")
|
1087 |
unichart_label_table=gr.DataFrame(visible=False,label="unichart ์ ๋ตํ
์ด๋ธ",elem_classes="dataframe-class")
|
1088 |
with gr.Column():
|
1089 |
+
ko_deplot_score_table=gr.DataFrame(visible=False,label="vaiv_deplot ์ ์",elem_classes="dataframe-class")
|
1090 |
aihub_deplot_score_table=gr.DataFrame(visible=False,label="aihub_deplot ์ ์",elem_classes="dataframe-class")
|
1091 |
unichart_score_table=gr.DataFrame(visible=False,label="unichart ์ ์",elem_classes="dataframe-class")
|
1092 |
model_type.change(
|