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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -25,13 +25,7 @@ def predict_segmentation(img):
25
  resized_img = cv2.resize(gray_img, im_size)
26
  # Predict the segmentation mask
27
  pred = learn.predict(resized_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 = 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)
35
  return output_image
36
 
37
  input_image = gr.inputs.Image()
 
25
  resized_img = cv2.resize(gray_img, im_size)
26
  # Predict the segmentation mask
27
  pred = learn.predict(resized_img)
28
+ output_image = pred[0]
 
 
 
 
 
 
29
  return output_image
30
 
31
  input_image = gr.inputs.Image()