DDingcheol commited on
Commit
d6b73e9
·
1 Parent(s): bc09c89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -83,16 +83,15 @@ def sepia(input_img):
83
  logits = tf.transpose(logits, [0, 2, 3, 1])
84
  logits = tf.image.resize(
85
  logits, input_img.size[::-1]
86
- ) # We reverse the shape of `image` because `image.size` returns width and height.
87
  seg = tf.math.argmax(logits, axis=-1)[0]
88
 
89
  color_seg = np.zeros(
90
  (seg.shape[0], seg.shape[1], 3), dtype=np.uint8
91
- ) # height, width, 3
92
  for label, color in enumerate(colormap):
93
  color_seg[seg.numpy() == label, :] = color
94
 
95
- # Show image + mask
96
  pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
97
  pred_img = pred_img.astype(np.uint8)
98
 
 
83
  logits = tf.transpose(logits, [0, 2, 3, 1])
84
  logits = tf.image.resize(
85
  logits, input_img.size[::-1]
86
+ )
87
  seg = tf.math.argmax(logits, axis=-1)[0]
88
 
89
  color_seg = np.zeros(
90
  (seg.shape[0], seg.shape[1], 3), dtype=np.uint8
91
+ )
92
  for label, color in enumerate(colormap):
93
  color_seg[seg.numpy() == label, :] = color
94
 
 
95
  pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
96
  pred_img = pred_img.astype(np.uint8)
97