Sangjun2 commited on
Commit
1ec3afd
ยท
verified ยท
1 Parent(s): 640f2b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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(