Spaces:
Runtime error
Runtime error
Commit
·
75554ed
1
Parent(s):
57f85b0
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,10 +16,10 @@ example_list = [["examples/" + example] for example in os.listdir("examples")]
|
|
| 16 |
# Predict Function
|
| 17 |
def predict(img):
|
| 18 |
# Apply Transformations
|
| 19 |
-
|
| 20 |
img=transform_gen(img).unsqueeze(0)
|
| 21 |
-
|
| 22 |
-
#
|
| 23 |
gen.eval()
|
| 24 |
with torch.inference_mode():
|
| 25 |
y_gen=gen(img)
|
|
@@ -27,6 +27,7 @@ def predict(img):
|
|
| 27 |
y_gen=to_img(y_gen)
|
| 28 |
return y_gen
|
| 29 |
|
|
|
|
| 30 |
# Gradio App
|
| 31 |
title="Image Segmentation GAN"
|
| 32 |
description="This segments a Normal Image"
|
|
|
|
| 16 |
# Predict Function
|
| 17 |
def predict(img):
|
| 18 |
# Apply Transformations
|
| 19 |
+
img=np.array(img)
|
| 20 |
img=transform_gen(img).unsqueeze(0)
|
| 21 |
+
|
| 22 |
+
# Predict
|
| 23 |
gen.eval()
|
| 24 |
with torch.inference_mode():
|
| 25 |
y_gen=gen(img)
|
|
|
|
| 27 |
y_gen=to_img(y_gen)
|
| 28 |
return y_gen
|
| 29 |
|
| 30 |
+
|
| 31 |
# Gradio App
|
| 32 |
title="Image Segmentation GAN"
|
| 33 |
description="This segments a Normal Image"
|