File size: 404 Bytes
a98ddcd
e913bcc
e3a10d5
0211f21
 
 
 
4abc5a0
0211f21
 
 
 
 
42c5390
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from UNet import *
from make_predictions import *
import torch
import gradio as gr

def getoutput(input_img):
    unet = UNet().to(device)
    unet = torch.load("unet_06_07_2022_17_13_42_256_256.pth", map_location=device).to(device)
    output_img = make_predictions(unet, input_img, threshold=0.5)
    return output_img

demo = gr.Interface(getoutput, gr.Image(shape=(200, 200)), "image")

demo.launch()