File size: 703 Bytes
3b6fea8
 
 
 
 
 
 
 
ec4a1e7
3b6fea8
1af5cc8
3b6fea8
ec4a1e7
1af5cc8
 
 
ec4a1e7
6091f66
1af5cc8
6091f66
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python

from __future__ import annotations

import gradio as gr

from model import Model

DESCRIPTION = "# [MangaLineExtraction_PyTorch](https://github.com/ljsabc/MangaLineExtraction_PyTorch)"

model = Model()

with gr.Blocks(css="style.css") as demo:
    gr.Markdown(DESCRIPTION)
    with gr.Row():
        with gr.Column():
            input_image = gr.Image(label="Input", type="numpy")
            run_button = gr.Button()
        with gr.Column():
            result = gr.Image(label="Result", elem_id="result")
    run_button.click(
        fn=model.predict,
        inputs=input_image,
        outputs=result,
    )

if __name__ == "__main__":
    demo.queue(max_size=20).launch()