dhanushreddy29 commited on
Commit
380b754
·
1 Parent(s): 1709591

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -28,6 +28,7 @@ def predict_segmentation(img):
28
  # Convert the predicted mask to a color image
29
  color_pred = pred[0].show(ctx=None, cmap='gray', alpha=None)
30
  # Convert the color image to a numpy array
 
31
  color_pred_array = color_pred_array.astype(np.uint8)
32
  # Convert the numpy array back to a PIL image
33
  output_image = Image.fromarray(color_pred_array)
 
28
  # Convert the predicted mask to a color image
29
  color_pred = pred[0].show(ctx=None, cmap='gray', alpha=None)
30
  # Convert the color image to a numpy array
31
+ color_pred_array = np.array(color_pred)
32
  color_pred_array = color_pred_array.astype(np.uint8)
33
  # Convert the numpy array back to a PIL image
34
  output_image = Image.fromarray(color_pred_array)