Spaces:
Runtime error
Runtime error
shivambhosale
commited on
Commit
•
0211f21
1
Parent(s):
03f66c6
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def getoutput(input_img):
|
6 |
+
unet = UNet().to(device)
|
7 |
+
unet = torch.load("unet_06_07_2022_17_13_42_256_256.pth").to(device)
|
8 |
+
output_img = make_predictions(unet, input_img, threshold=0.5)
|
9 |
+
return output_img
|
10 |
+
|
11 |
+
demo = gr.Interface(getoutput, gr.Image(shape=(200, 200)), "image")
|
12 |
+
|
13 |
+
demo.launch(share=True)
|