File size: 466 Bytes
a98ddcd
e913bcc
e3a10d5
0211f21
 
017d124
44c54df
4a24ad1
017d124
0211f21
 
6f4c263
 
 
 
0211f21
42c5390
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from UNet import *
from make_predictions import *
import torch
import gradio as gr

def getoutput(threshold,input_img):
    unet = UNet().to('cpu')
    unet = torch.load("unet_06_07_2022_22_43_42_1024_1024.pth", map_location='cpu').to('cpu')
    output_img = make_predictions(unet, input_img, threshold=threshold)
    return output_img

demo = gr.Interface(
    fn=getoutput, 
    inputs=["number", gr.Image(shape=(200, 200))], 
    outputs=["image"])

demo.launch()