vahidrezanezhad commited on
Commit
3720a03
·
verified ·
1 Parent(s): 5d59f41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -62,11 +62,8 @@ def do_prediction(img):
62
  label_p_pred = model.predict(img_patch.reshape(1, img_patch.shape[0], img_patch.shape[1], img_patch.shape[2]),
63
  verbose=0)
64
 
65
- print(label_p_pred.shape,'label_p_pred')
66
- print(img_patch.shape, 'img_patch')
67
  seg = np.argmax(label_p_pred, axis=3)[0]
68
 
69
- print(seg.shape, 'seg')
70
  seg_color = np.repeat(seg[:, :, np.newaxis], 3, axis=2)
71
 
72
  if i == 0 and j == 0:
@@ -117,9 +114,6 @@ def do_prediction(img):
117
 
118
  prediction_true = prediction_true.astype(np.uint8)
119
 
120
-
121
-
122
- print(prediction_true.shape, np.unique(prediction_true))
123
 
124
 
125
 
@@ -135,7 +129,7 @@ def do_prediction(img):
135
  print(prediction.shape)
136
 
137
  '''
138
- return prediction_true
139
 
140
  iface = gr.Interface(fn=do_prediction, inputs=gr.Image(), outputs=gr.Image())
141
  iface.launch()
 
62
  label_p_pred = model.predict(img_patch.reshape(1, img_patch.shape[0], img_patch.shape[1], img_patch.shape[2]),
63
  verbose=0)
64
 
 
 
65
  seg = np.argmax(label_p_pred, axis=3)[0]
66
 
 
67
  seg_color = np.repeat(seg[:, :, np.newaxis], 3, axis=2)
68
 
69
  if i == 0 and j == 0:
 
114
 
115
  prediction_true = prediction_true.astype(np.uint8)
116
 
 
 
 
117
 
118
 
119
 
 
129
  print(prediction.shape)
130
 
131
  '''
132
+ return prediction_true * 255
133
 
134
  iface = gr.Interface(fn=do_prediction, inputs=gr.Image(), outputs=gr.Image())
135
  iface.launch()