File size: 1,798 Bytes
475273d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import gradio as gr
from webui import (
    create_interface_sddfrcnn,
    create_interface_cyclegan,
    create_interactive_generative_inpainting,
    create_interface_style_transfer,
    create_interface_yolov8
)
from webui.runner import AttentionRunner,InpaintingRunner,CycleGANRunner,SDDFRCNNRunner,YOLORunner
import os
os.environ["no_proxy"] = "localhost,127.0.0.1,::1"


def main():
    attention_runner = AttentionRunner()
    inpainting_runner = InpaintingRunner()
    cyclegan_runner = CycleGANRunner()
    sddfrcnn_runner = SDDFRCNNRunner()
    yolo_runner = YOLORunner()

    with gr.Blocks(analytics_enabled=False,
                   title='Mars Life Exploration Platform',
                   ) as demo:
        md_txt = "# 火星生命探索平台" \
                "\n一个探索火星生命的综合平台,在这里你可以在样本中发现可能的生物体,修复它们,并尝试还原它们生前的样貌."
        gr.Markdown(md_txt)
        with gr.Tabs(selected='tab_sdd&frcnn'):
            with gr.TabItem("SDD & FRCNN",id='tab_sdd&frcnn'):
                create_interface_sddfrcnn(sddfrcnn_runner)

            with gr.TabItem("YOLOv8",id='tab_yolov8'):
                create_interface_yolov8(yolo_runner)

            with gr.TabItem("Generative Inpainting", id='tab_generative_inpainting'):
                create_interactive_generative_inpainting(inpainting_runner)

            with gr.TabItem("Style Transfer", id='tab_style_transfer'):
                create_interface_style_transfer(runner= attention_runner)

            with gr.TabItem("CycleGAN", id='tab_cyclegan'):
                create_interface_cyclegan(runner= cyclegan_runner)

        # demo.queue().launch()
        demo.launch(share=True, debug=False)


if __name__ == '__main__':
   main()