File size: 556 Bytes
bcc0f94 |
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 |
import os
import gradio as gr
from src.run.unet.inference import ResUnetInfer
infer = ResUnetInfer(
model_path="./checkpoint/resunet/decoder.pt",
config_path="./src/models/unet/config/resnet_config.yml",
)
demo = gr.Interface(
fn=infer.infer,
inputs=[
gr.Image(
shape=(224, 224),
label="Input Image",
value="./sample/bird_plane.jpeg",
)
],
outputs=[
gr.Image(),
],
examples=[[os.path.join("./sample/", f)] for f in os.listdir("./sample/")],
)
demo.launch()
|