import fn | |
import gradio as gr | |
fn.load_model() | |
with gr.Blocks() as demo: | |
title = gr.Markdown('# katanuki') | |
with gr.Row(): | |
src_image = gr.Image(label="Source", sources="upload", interactive=True, type="pil") | |
dst_image = gr.Image(label="Result", interactive=False, type="numpy") | |
src_image.change( | |
fn=fn.animeseg, | |
inputs=[src_image], | |
outputs=[dst_image], | |
) | |
if __name__ == '__main__': | |
demo.launch() | |