Trang Dang commited on
Commit
86680ae
1 Parent(s): d152f7f
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,6 +1,5 @@
1
  from pathlib import Path
2
  from typing import List, Dict, Tuple
3
- import matplotlib.colors as mpl_colors
4
  import pandas as pd
5
  import seaborn as sns
6
  import shinyswatch
@@ -31,7 +30,6 @@ def server(input: Inputs, output: Outputs, session: Session):
31
  @render.image
32
  def image():
33
  if input.image_input():
34
- # print(input.image_input())
35
  src = input.image_input()[0]['datapath']
36
  img = {"src": src, "width": "500px"}
37
  return img
@@ -42,13 +40,13 @@ def server(input: Inputs, output: Outputs, session: Session):
42
  def plot_output():
43
  if input.image_input():
44
  src = input.image_input()[0]['datapath']
45
- single_patch_prob, single_patch_prediction = run.pred(src)
46
  fig, axes = plt.subplots(1, 2, figsize=(15, 5))
47
 
48
- axes[0].imshow(single_patch_prob, cmap='gray')
49
  axes[0].set_title("Probability Map")
50
 
51
- im = axes[1].imshow(single_patch_prediction)
52
  axes[1].set_title("Prediction")
53
  cbar = fig.colorbar(im, ax=axes[1])
54
 
 
1
  from pathlib import Path
2
  from typing import List, Dict, Tuple
 
3
  import pandas as pd
4
  import seaborn as sns
5
  import shinyswatch
 
30
  @render.image
31
  def image():
32
  if input.image_input():
 
33
  src = input.image_input()[0]['datapath']
34
  img = {"src": src, "width": "500px"}
35
  return img
 
40
  def plot_output():
41
  if input.image_input():
42
  src = input.image_input()[0]['datapath']
43
+ prob, prediction = run.pred(src)
44
  fig, axes = plt.subplots(1, 2, figsize=(15, 5))
45
 
46
+ axes[0].imshow(prob, cmap='gray')
47
  axes[0].set_title("Probability Map")
48
 
49
+ im = axes[1].imshow(prediction)
50
  axes[1].set_title("Prediction")
51
  cbar = fig.colorbar(im, ax=axes[1])
52