yuragoithf commited on
Commit
432e19c
·
1 Parent(s): 8e52ff9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -66,13 +66,13 @@ def gen_pred(img, model=seg_model):
66
  pred = model.predict(img)
67
  pred = np.squeeze(pred, axis=0)
68
  # image = Image.fromarray(np.uint8(cm.plasma(pred)*255))
69
- pil_img = Image.fromarray(pred, 'RGB')
70
  # im = Image.fromarray((pred * 255).astype(np.uint8))
71
  # img_bytes = pred.tobytes()
72
  # nparr = np.frombuffer(img_bytes, np.byte)
73
  # pred_pil = cv2.imdecode(nparr, cv2.IMREAD_REDUCED_COLOR_8)
74
  # return "UI in developing process ..."
75
- return pil_img
76
 
77
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
78
  description = "Upload an image and get prediction mask"
 
66
  pred = model.predict(img)
67
  pred = np.squeeze(pred, axis=0)
68
  # image = Image.fromarray(np.uint8(cm.plasma(pred)*255))
69
+ # pil_img = Image.fromarray(pred, 'RGB')
70
  # im = Image.fromarray((pred * 255).astype(np.uint8))
71
  # img_bytes = pred.tobytes()
72
  # nparr = np.frombuffer(img_bytes, np.byte)
73
  # pred_pil = cv2.imdecode(nparr, cv2.IMREAD_REDUCED_COLOR_8)
74
  # return "UI in developing process ..."
75
+ return pred
76
 
77
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
78
  description = "Upload an image and get prediction mask"