yuragoithf commited on
Commit
a4c8a40
·
1 Parent(s): 0ed3925

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -64,11 +64,11 @@ def gen_pred(img, model=seg_model):
64
  img = tf.expand_dims(img, axis=0)
65
  pred = model.predict(img)
66
  pred = np.squeeze(pred, axis=0)
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 pred_pil
72
 
73
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
74
  description = "Upload an image and get prediction mask"
 
64
  img = tf.expand_dims(img, axis=0)
65
  pred = model.predict(img)
66
  pred = np.squeeze(pred, axis=0)
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 pred
72
 
73
  title = "<h1 style='text-align: center;'>Semantic Segmentation</h1>"
74
  description = "Upload an image and get prediction mask"