maxbetjes commited on
Commit
937a2b5
·
verified ·
1 Parent(s): 5f33f15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -40,6 +40,7 @@ def tif_view(filepath, z):
40
  else:
41
  raise ValueError("TIF cannot have more than three dimensions")
42
 
 
43
  img = img[:, :, z:(z+3)]
44
 
45
  Ly, Lx, nchan = img.shape
@@ -111,9 +112,9 @@ def norm_path(filepath):
111
  return filepath
112
 
113
  def update_image(filepath, z):
114
- print('update_img')
115
- for f in filepath:
116
- f = tif_view(f, z)
117
  filepath_show = tif_view(filepath[-1], z)
118
  filepath_show = norm_path(filepath_show)
119
  print(filepath_show)
@@ -172,6 +173,8 @@ with gr.Blocks(title = "Hello",
172
  input_image.upload(update_button, [input_image, depth], [input_image, up_btn, output_image1, output_image2])
173
  up_btn.upload(update_image, [up_btn, depth], [input_image, up_btn, output_image1, output_image2])
174
  depth.change(update_image, [up_btn, depth], [input_image, up_btn, output_image1, output_image2])
 
 
175
 
176
  #send_btn.click(cellpose_segment, [up_btn, resize, max_iter], [outlines, flows, down_btn, down_btn2])
177
 
 
40
  else:
41
  raise ValueError("TIF cannot have more than three dimensions")
42
 
43
+ print(z)
44
  img = img[:, :, z:(z+3)]
45
 
46
  Ly, Lx, nchan = img.shape
 
112
  return filepath
113
 
114
  def update_image(filepath, z):
115
+ print('update_img')
116
+ #for f in filepath:
117
+ #f = tif_view(f, z)
118
  filepath_show = tif_view(filepath[-1], z)
119
  filepath_show = norm_path(filepath_show)
120
  print(filepath_show)
 
173
  input_image.upload(update_button, [input_image, depth], [input_image, up_btn, output_image1, output_image2])
174
  up_btn.upload(update_image, [up_btn, depth], [input_image, up_btn, output_image1, output_image2])
175
  depth.change(update_image, [up_btn, depth], [input_image, up_btn, output_image1, output_image2])
176
+ #depth.change(update_depth, [up_btn, depth], depth)
177
+
178
 
179
  #send_btn.click(cellpose_segment, [up_btn, resize, max_iter], [outlines, flows, down_btn, down_btn2])
180