kitooo commited on
Commit
b07262b
1 Parent(s): aaaedd1

updated app

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -26,6 +26,14 @@ def segment_sidewalk(image):
26
  save_image(prediction, 'mask.png', cmap='gray')
27
  return Image.open('image.png'), Image.open('mask.png'), Image.open('prob.png')
28
 
 
 
 
 
 
 
 
 
29
  with gr.Blocks() as demo:
30
  with gr.Row():
31
  with gr.Column():
 
26
  save_image(prediction, 'mask.png', cmap='gray')
27
  return Image.open('image.png'), Image.open('mask.png'), Image.open('prob.png')
28
 
29
+ def save_image(image, path, **kwargs):
30
+ plt.figure(figsize=(8, 8))
31
+ plt.imshow(image, interpolation='nearest', **kwargs)
32
+ plt.axis('off')
33
+ plt.tight_layout()
34
+ plt.savefig(path, bbox_inches='tight', pad_inches=0)
35
+ plt.close()
36
+
37
  with gr.Blocks() as demo:
38
  with gr.Row():
39
  with gr.Column():