mouseland commited on
Commit
4bde3b4
·
verified ·
1 Parent(s): 5261ab2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -254,13 +254,13 @@ def upload_file(filepath):
254
 
255
 
256
  def update_image(filepath):
257
- img = imread(filepath)
258
- img = normalize99(img)
259
- img = np.clip(img, 0, 1)
260
 
261
  #b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
262
  #b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
263
- return input_image, filepath#, b1, b2
264
 
265
  with gr.Blocks(title = "Hello",
266
  css=".gradio-container {background:purple;}") as demo:
@@ -305,9 +305,9 @@ with gr.Blocks(title = "Hello",
305
  sample_list.append("samples/img%0.2d.png"%j)
306
  gr.Examples(sample_list, inputs=input_image, examples_per_page=25, label = "Click on an example to try it")
307
 
308
- #input_image.change(update_image, input_image, [input_image, filepath])
309
  up_btn.upload(upload_file, up_btn, [input_image])
310
- send_btn.click(cellpose_segment, [input_image, resize], [img_outlines, flows, down_btn, down_btn2])
311
 
312
  #down_btn.click(download_function, None, [down_btn, down_btn2])
313
 
 
254
 
255
 
256
  def update_image(filepath):
257
+ #img = imread(filepath)
258
+ #img = normalize99(img)
259
+ #img = np.clip(img, 0, 1)
260
 
261
  #b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
262
  #b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
263
+ return filepath#, b1, b2
264
 
265
  with gr.Blocks(title = "Hello",
266
  css=".gradio-container {background:purple;}") as demo:
 
305
  sample_list.append("samples/img%0.2d.png"%j)
306
  gr.Examples(sample_list, inputs=input_image, examples_per_page=25, label = "Click on an example to try it")
307
 
308
+ input_image.upload(update_image, input_image, up_btn)
309
  up_btn.upload(upload_file, up_btn, [input_image])
310
+ send_btn.click(cellpose_segment, [up_btn, resize], [img_outlines, flows, down_btn, down_btn2])
311
 
312
  #down_btn.click(download_function, None, [down_btn, down_btn2])
313