Fabrice-TIERCELIN
commited on
Commit
•
d000939
1
Parent(s):
a9d7ba6
Remove unused components
Browse files- gradio_demo.py +8 -23
gradio_demo.py
CHANGED
@@ -412,7 +412,7 @@ def restore(
|
|
412 |
print(information)
|
413 |
|
414 |
# Only one image can be shown in the slider
|
415 |
-
return [input_image] + [results[0]], gr.update(format = output_format, value = [input_image] + results), gr.update(value = information, visible = True)
|
416 |
|
417 |
def load_and_reset(param_setting):
|
418 |
print('load_and_reset ==>>')
|
@@ -482,8 +482,8 @@ title_html = """
|
|
482 |
The content added by SUPIR is <b><u>imagination, not real-world information</u></b>.
|
483 |
The aim of SUPIR is the beauty and the illustration.
|
484 |
Most of the processes only last few minutes.
|
485 |
-
This demo can handle huge images but the process will be aborted if it lasts more than
|
486 |
-
Please leave a message in discussion if you encounter issues.
|
487 |
|
488 |
<p><center><a href="https://arxiv.org/abs/2401.13627">Paper</a>   <a href="http://supir.xpixel.group/">Project Page</a>   <a href="https://huggingface.co/blog/MonsterMMORPG/supir-sota-image-upscale-better-than-magnific-ai">Local Install Guide</a></center></p>
|
489 |
"""
|
@@ -528,11 +528,6 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
528 |
denoise_image = gr.Image(label="Denoised image", show_label=True, type="numpy", sources=[], height=600, elem_id="image-s1")
|
529 |
denoise_information = gr.HTML(value="If present, the denoised image will be used for the restoration instead of the input image.", visible=False)
|
530 |
|
531 |
-
with gr.Accordion("LLaVA options", open=False, visible=False):
|
532 |
-
temperature = gr.Slider(label="Temperature", info = "lower=Always similar, higher=More creative", minimum=0., maximum=1.0, value=0.2, step=0.1)
|
533 |
-
top_p = gr.Slider(label="Top P", info = "Percent of tokens shortlisted", minimum=0., maximum=1.0, value=0.7, step=0.1)
|
534 |
-
qs = gr.Textbox(label="Question", info="Ask LLaVa what description you want", value="Describe the image and its style in a very detailed manner. The image is a realistic photography, not an art painting.", lines=3)
|
535 |
-
|
536 |
with gr.Accordion("Advanced options", open=False):
|
537 |
a_prompt = gr.Textbox(label="Additional image description",
|
538 |
info="Completes the main image description",
|
@@ -588,20 +583,12 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
588 |
restart_button = gr.Button(value="Apply presetting")
|
589 |
|
590 |
with gr.Group():
|
591 |
-
llave_button = gr.Button(value="Generate description by LlaVa (disabled)", visible=False)
|
592 |
-
|
593 |
diffusion_button = gr.Button(value="🚀 Upscale/Restore", variant = "primary", elem_id="process_button")
|
594 |
|
595 |
-
restore_information = gr.HTML(value="Restart the process to get another result.", visible=False)
|
596 |
result_slider = ImageSlider(label='Output', show_label=True, elem_id="slider1")
|
597 |
result_gallery = gr.Gallery(label='Output', show_label=True, elem_id="gallery1")
|
598 |
|
599 |
-
with gr.Accordion("Feedback", open=True, visible=False):
|
600 |
-
fb_score = gr.Slider(label="Feedback Score", minimum=1, maximum=5, value=3, step=1, interactive=True)
|
601 |
-
fb_text = gr.Textbox(label="Feedback Text", value="", placeholder='Please enter your feedback here.')
|
602 |
-
submit_button = gr.Button(value="Submit Feedback")
|
603 |
-
event_id = gr.Textbox(label="Event ID", value="", visible=False)
|
604 |
-
|
605 |
gr.Examples(
|
606 |
run_on_click = True,
|
607 |
fn = stage2_process,
|
@@ -639,8 +626,7 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
639 |
outputs = [
|
640 |
result_slider,
|
641 |
result_gallery,
|
642 |
-
restore_information
|
643 |
-
event_id
|
644 |
],
|
645 |
examples = [
|
646 |
[
|
@@ -672,7 +658,7 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
672 |
0.,
|
673 |
"v0-Q",
|
674 |
"png",
|
675 |
-
|
676 |
],
|
677 |
[
|
678 |
"./Examples/Example2.jpeg",
|
@@ -703,7 +689,7 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
703 |
0.,
|
704 |
"v0-Q",
|
705 |
"png",
|
706 |
-
|
707 |
],
|
708 |
],
|
709 |
cache_examples = False,
|
@@ -768,8 +754,7 @@ with gr.Blocks(title="SUPIR") as interface:
|
|
768 |
], outputs = [
|
769 |
result_slider,
|
770 |
result_gallery,
|
771 |
-
restore_information
|
772 |
-
event_id
|
773 |
]).success(fn = log_information, inputs = [
|
774 |
result_gallery
|
775 |
], outputs = [], queue = False, show_progress = False)
|
|
|
412 |
print(information)
|
413 |
|
414 |
# Only one image can be shown in the slider
|
415 |
+
return [input_image] + [results[0]], gr.update(format = output_format, value = [input_image] + results), gr.update(value = information, visible = True)
|
416 |
|
417 |
def load_and_reset(param_setting):
|
418 |
print('load_and_reset ==>>')
|
|
|
482 |
The content added by SUPIR is <b><u>imagination, not real-world information</u></b>.
|
483 |
The aim of SUPIR is the beauty and the illustration.
|
484 |
Most of the processes only last few minutes.
|
485 |
+
This demo can handle huge images but the process will be aborted if it lasts more than 8 min.
|
486 |
+
Please <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR/discussions/new">leave a message in discussion</a> if you encounter issues.
|
487 |
|
488 |
<p><center><a href="https://arxiv.org/abs/2401.13627">Paper</a>   <a href="http://supir.xpixel.group/">Project Page</a>   <a href="https://huggingface.co/blog/MonsterMMORPG/supir-sota-image-upscale-better-than-magnific-ai">Local Install Guide</a></center></p>
|
489 |
"""
|
|
|
528 |
denoise_image = gr.Image(label="Denoised image", show_label=True, type="numpy", sources=[], height=600, elem_id="image-s1")
|
529 |
denoise_information = gr.HTML(value="If present, the denoised image will be used for the restoration instead of the input image.", visible=False)
|
530 |
|
|
|
|
|
|
|
|
|
|
|
531 |
with gr.Accordion("Advanced options", open=False):
|
532 |
a_prompt = gr.Textbox(label="Additional image description",
|
533 |
info="Completes the main image description",
|
|
|
583 |
restart_button = gr.Button(value="Apply presetting")
|
584 |
|
585 |
with gr.Group():
|
|
|
|
|
586 |
diffusion_button = gr.Button(value="🚀 Upscale/Restore", variant = "primary", elem_id="process_button")
|
587 |
|
588 |
+
restore_information = gr.HTML(value="Restart the process to get another result.", visible = False)
|
589 |
result_slider = ImageSlider(label='Output', show_label=True, elem_id="slider1")
|
590 |
result_gallery = gr.Gallery(label='Output', show_label=True, elem_id="gallery1")
|
591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
gr.Examples(
|
593 |
run_on_click = True,
|
594 |
fn = stage2_process,
|
|
|
626 |
outputs = [
|
627 |
result_slider,
|
628 |
result_gallery,
|
629 |
+
restore_information
|
|
|
630 |
],
|
631 |
examples = [
|
632 |
[
|
|
|
658 |
0.,
|
659 |
"v0-Q",
|
660 |
"png",
|
661 |
+
5
|
662 |
],
|
663 |
[
|
664 |
"./Examples/Example2.jpeg",
|
|
|
689 |
0.,
|
690 |
"v0-Q",
|
691 |
"png",
|
692 |
+
4
|
693 |
],
|
694 |
],
|
695 |
cache_examples = False,
|
|
|
754 |
], outputs = [
|
755 |
result_slider,
|
756 |
result_gallery,
|
757 |
+
restore_information
|
|
|
758 |
]).success(fn = log_information, inputs = [
|
759 |
result_gallery
|
760 |
], outputs = [], queue = False, show_progress = False)
|