shivambhosale commited on
Commit
017d124
1 Parent(s): 4a24ad1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,12 +3,12 @@ from make_predictions import *
3
  import torch
4
  import gradio as gr
5
 
6
- def getoutput(input_img):
7
  unet = UNet().to('cpu')
8
  unet = torch.load("unet_06_07_2022_22_43_42_1024_1024.pth", map_location='cpu').to('cpu')
9
- output_img = make_predictions(unet, input_img, threshold=0.05)
10
  return output_img
11
 
12
- demo = gr.Interface(getoutput, gr.Image(shape=(200, 200)), "image")
13
 
14
  demo.launch()
3
  import torch
4
  import gradio as gr
5
 
6
+ def getoutput(threshold,input_img):
7
  unet = UNet().to('cpu')
8
  unet = torch.load("unet_06_07_2022_22_43_42_1024_1024.pth", map_location='cpu').to('cpu')
9
+ output_img = make_predictions(unet, input_img, threshold=threshold)
10
  return output_img
11
 
12
+ demo = gr.Interface(getoutput, ["number",gr.Image(shape=(200, 200))], "image")
13
 
14
  demo.launch()