Plsek commited on
Commit
32d9557
·
1 Parent(s): f94b0b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -44,16 +44,14 @@ def plot_image(image, scale):
44
  plt.gca().add_patch(Rectangle((x0, x0), scale*128, scale*128, linewidth=1, edgecolor='w', facecolor='none'))
45
 
46
  plt.axis('off')
47
- # with colA:
48
- st.pyplot()
49
 
50
  # Define function to plot the prediction
51
  def plot_prediction(pred):
52
  plt.figure(figsize=(4, 4))
53
  plt.imshow(pred, origin="lower")
54
  plt.axis('off')
55
- # with colB:
56
- st.pyplot()
57
 
58
  # Cut input image and rebin it to 128x128 pixels
59
  def cut(data0, wcs0, scale=1):
@@ -136,8 +134,7 @@ if uploaded_file is not None:
136
  _, colA, colB, colC, _ = st.columns([bordersize,1,1,1,bordersize])
137
 
138
  image = np.log10(data+1)
139
- with colA:
140
- plot_image(image, scale)
141
 
142
  if detect:
143
  data, wcs = cut(data, wcs, scale=scale)
 
44
  plt.gca().add_patch(Rectangle((x0, x0), scale*128, scale*128, linewidth=1, edgecolor='w', facecolor='none'))
45
 
46
  plt.axis('off')
47
+ with colA: st.pyplot()
 
48
 
49
  # Define function to plot the prediction
50
  def plot_prediction(pred):
51
  plt.figure(figsize=(4, 4))
52
  plt.imshow(pred, origin="lower")
53
  plt.axis('off')
54
+ with colB: st.pyplot()
 
55
 
56
  # Cut input image and rebin it to 128x128 pixels
57
  def cut(data0, wcs0, scale=1):
 
134
  _, colA, colB, colC, _ = st.columns([bordersize,1,1,1,bordersize])
135
 
136
  image = np.log10(data+1)
137
+ plot_image(image, scale)
 
138
 
139
  if detect:
140
  data, wcs = cut(data, wcs, scale=scale)