Commit
·
a79dc03
1
Parent(s):
909e13b
Update app.py
Browse files
app.py
CHANGED
@@ -65,10 +65,10 @@ def gen_pred(img, model=seg_model):
|
|
65 |
pred = np.squeeze(pred, axis=0)
|
66 |
print(pred)
|
67 |
img_bytes = pred.tobytes()
|
68 |
-
|
69 |
# pred_pil = cv2.imdecode(nparr, cv2.IMREAD_REDUCED_COLOR_8)
|
70 |
# return "UI in developing process ..."
|
71 |
-
return
|
72 |
|
73 |
title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
|
74 |
description = "Upload an image and get prediction mask"
|
|
|
65 |
pred = np.squeeze(pred, axis=0)
|
66 |
print(pred)
|
67 |
img_bytes = pred.tobytes()
|
68 |
+
nparr = np.frombuffer(img_bytes, np.byte)
|
69 |
# pred_pil = cv2.imdecode(nparr, cv2.IMREAD_REDUCED_COLOR_8)
|
70 |
# return "UI in developing process ..."
|
71 |
+
return nparr
|
72 |
|
73 |
title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
|
74 |
description = "Upload an image and get prediction mask"
|