maxbetjes commited on
Commit
76d3c68
·
verified ·
1 Parent(s): f25068c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -130,7 +130,7 @@ def update_image(filepath, z):
130
  filepath_show = norm_path(filepath_show)
131
  print(filepath_show)
132
  print(filepath)
133
- return filepath_show, filepath, fp0
134
 
135
  def update_button(filepath, z):
136
  print('update_btn')
@@ -138,7 +138,7 @@ def update_button(filepath, z):
138
  filepath_show = tif_view(filepath, z)
139
  filepath_show = norm_path(filepath_show)
140
  print(filepath_show)
141
- return filepath_show, [filepath], fp0
142
 
143
  def update_z(filepath, filepath_result, z):
144
  print('update_img')
@@ -155,7 +155,7 @@ def update_z(filepath, filepath_result, z):
155
  print(filepath_show)
156
  print(filepath)
157
 
158
- return filepath_show, filepath_result_show
159
 
160
  def detect_cells(filepath, z):
161
  model = tf.keras.models.load_model('./model_positions', compile=False)
@@ -180,7 +180,7 @@ def detect_cells(filepath, z):
180
 
181
  coordinates = peak_local_max(result, min_distance=2, threshold_abs=0.2, exclude_border=False)
182
 
183
- return filepath_result, filepath_result_show
184
 
185
 
186
  with gr.Blocks(title = "Hello",
@@ -217,7 +217,8 @@ with gr.Blocks(title = "Hello",
217
 
218
  with gr.Column(scale=2):
219
  #
220
- output_image = gr.Image(label = "Output", type = "filepath")
 
221
 
222
  #sample_list = glob.glob("samples/*.png")
223
  #sample_list = []
 
130
  filepath_show = norm_path(filepath_show)
131
  print(filepath_show)
132
  print(filepath)
133
+ return filepath_show, filepath, (fp0, [((5, 5, 10, 10), 'nothing')])
134
 
135
  def update_button(filepath, z):
136
  print('update_btn')
 
138
  filepath_show = tif_view(filepath, z)
139
  filepath_show = norm_path(filepath_show)
140
  print(filepath_show)
141
+ return filepath_show, [filepath], (fp0, [((5, 5, 10, 10), 'nothing')])
142
 
143
  def update_z(filepath, filepath_result, z):
144
  print('update_img')
 
155
  print(filepath_show)
156
  print(filepath)
157
 
158
+ return filepath_show, (filepath_result_show, [((5, 5, 10, 10), 'nothing')])
159
 
160
  def detect_cells(filepath, z):
161
  model = tf.keras.models.load_model('./model_positions', compile=False)
 
180
 
181
  coordinates = peak_local_max(result, min_distance=2, threshold_abs=0.2, exclude_border=False)
182
 
183
+ return filepath_result, (filepath_result_show, [((5, 5, 10, 10), 'nothing')])
184
 
185
 
186
  with gr.Blocks(title = "Hello",
 
217
 
218
  with gr.Column(scale=2):
219
  #
220
+ #output_image = gr.Image(label = "Output", type = "filepath")
221
+ output_image = gr.AnnotatedImage(label = "Output")
222
 
223
  #sample_list = glob.glob("samples/*.png")
224
  #sample_list = []