Spaces:
Sleeping
Sleeping
Commit
·
856ccf3
1
Parent(s):
88c30d3
update
Browse files
app.py
CHANGED
@@ -414,8 +414,8 @@ with gr.Blocks() as demo:
|
|
414 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
415 |
"""
|
416 |
# finalize and save the mapping results
|
417 |
-
|
418 |
-
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info,
|
419 |
|
420 |
stage1_info["state"] = "finished"
|
421 |
yield {stage1_json : stage1_info,
|
@@ -424,7 +424,7 @@ with gr.Blocks() as demo:
|
|
424 |
tpl_img : gr.Image(visible=False),
|
425 |
mapped_img : gr.Image(visible=False),
|
426 |
next_btn : gr.Button(visible=False),
|
427 |
-
out_result_file : gr.File(
|
428 |
# step1 to step2
|
429 |
elif in_num > matched_num:
|
430 |
md = """
|
@@ -503,15 +503,15 @@ with gr.Blocks() as demo:
|
|
503 |
The mapping process has been finished.
|
504 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
505 |
"""
|
506 |
-
|
507 |
-
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info,
|
508 |
|
509 |
stage1_info["state"] = "finished"
|
510 |
yield {stage1_json : stage1_info,
|
511 |
channel_json : channel_info,
|
512 |
desc_md : gr.Markdown(md),
|
513 |
radio_group : gr.Radio(visible=False),
|
514 |
-
out_result_file : gr.File(
|
515 |
clear_btn : gr.Button(visible=False),
|
516 |
next_btn : gr.Button(visible=False)}
|
517 |
# step2 to step3-1
|
@@ -539,8 +539,8 @@ with gr.Blocks() as demo:
|
|
539 |
The mapping process has been finished.
|
540 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
541 |
"""
|
542 |
-
|
543 |
-
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info,
|
544 |
|
545 |
stage1_info["state"] = "finished"
|
546 |
yield {stage1_json : stage1_info,
|
@@ -548,7 +548,7 @@ with gr.Blocks() as demo:
|
|
548 |
desc_md : gr.Markdown(md),
|
549 |
in_fillmode : gr.Dropdown(visible=False),
|
550 |
fillmode_btn : gr.Button(visible=False),
|
551 |
-
out_result_file : gr.File(
|
552 |
# step3-1 to step3-2
|
553 |
elif fillmode == "mean":
|
554 |
md = """
|
@@ -607,8 +607,8 @@ with gr.Blocks() as demo:
|
|
607 |
The mapping process has been finished.
|
608 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
609 |
"""
|
610 |
-
|
611 |
-
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info,
|
612 |
|
613 |
stage1_info["state"] = "finished"
|
614 |
yield {stage1_json : stage1_info,
|
@@ -616,7 +616,7 @@ with gr.Blocks() as demo:
|
|
616 |
desc_md : gr.Markdown(md),
|
617 |
chkbox_group : gr.CheckboxGroup(visible=False),
|
618 |
next_btn : gr.Button(visible=False),
|
619 |
-
out_result_file : gr.File(
|
620 |
|
621 |
next_btn.click(
|
622 |
fn = init_next_step,
|
|
|
414 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
415 |
"""
|
416 |
# finalize and save the mapping results
|
417 |
+
outputname = stage1_info["fileNames"]["outputResult"]
|
418 |
+
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info, outputname)
|
419 |
|
420 |
stage1_info["state"] = "finished"
|
421 |
yield {stage1_json : stage1_info,
|
|
|
424 |
tpl_img : gr.Image(visible=False),
|
425 |
mapped_img : gr.Image(visible=False),
|
426 |
next_btn : gr.Button(visible=False),
|
427 |
+
out_result_file : gr.File(outputname, visible=True)}
|
428 |
# step1 to step2
|
429 |
elif in_num > matched_num:
|
430 |
md = """
|
|
|
503 |
The mapping process has been finished.
|
504 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
505 |
"""
|
506 |
+
outputname = stage1_info["fileNames"]["outputResult"]
|
507 |
+
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info, outputname)
|
508 |
|
509 |
stage1_info["state"] = "finished"
|
510 |
yield {stage1_json : stage1_info,
|
511 |
channel_json : channel_info,
|
512 |
desc_md : gr.Markdown(md),
|
513 |
radio_group : gr.Radio(visible=False),
|
514 |
+
out_result_file : gr.File(outputname, visible=True),
|
515 |
clear_btn : gr.Button(visible=False),
|
516 |
next_btn : gr.Button(visible=False)}
|
517 |
# step2 to step3-1
|
|
|
539 |
The mapping process has been finished.
|
540 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
541 |
"""
|
542 |
+
outputname = stage1_info["fileNames"]["outputResult"]
|
543 |
+
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info, outputname)
|
544 |
|
545 |
stage1_info["state"] = "finished"
|
546 |
yield {stage1_json : stage1_info,
|
|
|
548 |
desc_md : gr.Markdown(md),
|
549 |
in_fillmode : gr.Dropdown(visible=False),
|
550 |
fillmode_btn : gr.Button(visible=False),
|
551 |
+
out_result_file : gr.File(outputname, visible=True)}
|
552 |
# step3-1 to step3-2
|
553 |
elif fillmode == "mean":
|
554 |
md = """
|
|
|
607 |
The mapping process has been finished.
|
608 |
Download the file below if you plan to run the models using the <a href="">source code</a>.
|
609 |
"""
|
610 |
+
outputname = stage1_info["fileNames"]["outputResult"]
|
611 |
+
stage1_info, channel_info = app_utils.mapping_result(stage1_info, channel_info, outputname)
|
612 |
|
613 |
stage1_info["state"] = "finished"
|
614 |
yield {stage1_json : stage1_info,
|
|
|
616 |
desc_md : gr.Markdown(md),
|
617 |
chkbox_group : gr.CheckboxGroup(visible=False),
|
618 |
next_btn : gr.Button(visible=False),
|
619 |
+
out_result_file : gr.File(outputname, visible=True)}
|
620 |
|
621 |
next_btn.click(
|
622 |
fn = init_next_step,
|