Spaces:
Sleeping
Sleeping
single_download_csv_output = gr.File(label="下载 CSV")
Browse files
app.py
CHANGED
|
@@ -287,7 +287,6 @@ def show_single_question_image(data):
|
|
| 287 |
image_url = question_json['圖片URL']
|
| 288 |
return image_url
|
| 289 |
|
| 290 |
-
|
| 291 |
def show_single_question_markdown(data):
|
| 292 |
if len(data) == 0:
|
| 293 |
return ""
|
|
@@ -341,14 +340,15 @@ with gr.Blocks() as demo:
|
|
| 341 |
submit_button = gr.Button("開始處理圖片")
|
| 342 |
with gr.Row():
|
| 343 |
result_text = gr.Textbox(label="處理結果")
|
| 344 |
-
with gr.Row():
|
| 345 |
-
result_table = gr.Dataframe(
|
| 346 |
-
headers=["圖片URL", "文字", "題號", "題目", "選項1", "選項2", "選項3", "選項4", "答案", "提示1", "提示2", "提示3", "提示4", "提示5", "Perseus JSON"],
|
| 347 |
-
column_widths=[10, 10, 5, 20, 4, 4, 4, 4, 4,4,4,4,4,4, 10],
|
| 348 |
-
wrap=True
|
| 349 |
-
)
|
| 350 |
with gr.Row():
|
| 351 |
download_csv_output = gr.File(label="下载 CSV")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
|
| 353 |
with gr.Tab("單張處理"):
|
| 354 |
with gr.Row():
|
|
@@ -360,6 +360,8 @@ with gr.Blocks() as demo:
|
|
| 360 |
with gr.Row():
|
| 361 |
single_question_image = gr.Image()
|
| 362 |
single_question_markdown = gr.Markdown(show_label=False, latex_delimiters=[{"left": "$", "right": "$", "display": False}])
|
|
|
|
|
|
|
| 363 |
with gr.Accordion(open=False):
|
| 364 |
with gr.Row():
|
| 365 |
single_result_table = gr.Dataframe(
|
|
@@ -367,9 +369,6 @@ with gr.Blocks() as demo:
|
|
| 367 |
column_widths=[10, 10, 5, 20, 4, 4, 4, 4, 4,4,4,4,4,4, 10],
|
| 368 |
wrap=True
|
| 369 |
)
|
| 370 |
-
with gr.Row():
|
| 371 |
-
single_download_csv_output = gr.File(label="下载 CSV")
|
| 372 |
-
|
| 373 |
|
| 374 |
submit_button.click(
|
| 375 |
fn=process_image_to_data,
|
|
|
|
| 287 |
image_url = question_json['圖片URL']
|
| 288 |
return image_url
|
| 289 |
|
|
|
|
| 290 |
def show_single_question_markdown(data):
|
| 291 |
if len(data) == 0:
|
| 292 |
return ""
|
|
|
|
| 340 |
submit_button = gr.Button("開始處理圖片")
|
| 341 |
with gr.Row():
|
| 342 |
result_text = gr.Textbox(label="處理結果")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 343 |
with gr.Row():
|
| 344 |
download_csv_output = gr.File(label="下载 CSV")
|
| 345 |
+
with gr.Accordion(open=False):
|
| 346 |
+
with gr.Row():
|
| 347 |
+
result_table = gr.Dataframe(
|
| 348 |
+
headers=["圖片URL", "文字", "題號", "題目", "選項1", "選項2", "選項3", "選項4", "答案", "提示1", "提示2", "提示3", "提示4", "提示5", "Perseus JSON"],
|
| 349 |
+
column_widths=[10, 10, 5, 20, 4, 4, 4, 4, 4,4,4,4,4,4, 10],
|
| 350 |
+
wrap=True
|
| 351 |
+
)
|
| 352 |
|
| 353 |
with gr.Tab("單張處理"):
|
| 354 |
with gr.Row():
|
|
|
|
| 360 |
with gr.Row():
|
| 361 |
single_question_image = gr.Image()
|
| 362 |
single_question_markdown = gr.Markdown(show_label=False, latex_delimiters=[{"left": "$", "right": "$", "display": False}])
|
| 363 |
+
with gr.Row():
|
| 364 |
+
single_download_csv_output = gr.File(label="下载 CSV")
|
| 365 |
with gr.Accordion(open=False):
|
| 366 |
with gr.Row():
|
| 367 |
single_result_table = gr.Dataframe(
|
|
|
|
| 369 |
column_widths=[10, 10, 5, 20, 4, 4, 4, 4, 4,4,4,4,4,4, 10],
|
| 370 |
wrap=True
|
| 371 |
)
|
|
|
|
|
|
|
|
|
|
| 372 |
|
| 373 |
submit_button.click(
|
| 374 |
fn=process_image_to_data,
|