mouseland commited on
Commit
fcdd787
·
verified ·
1 Parent(s): 741a210

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -241,7 +241,7 @@ def download_function():
241
  return b1, b2
242
 
243
  def upload_file(filepath):
244
- img = imread(filepath)
245
  #img = normalize99(img)
246
  #img = np.clip(img, 0, 1)
247
 
@@ -250,7 +250,7 @@ def upload_file(filepath):
250
 
251
  #b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
252
  #b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
253
- return [filepath] #, b1, b2
254
 
255
 
256
  def update_image(filepath):
@@ -260,7 +260,7 @@ def update_image(filepath):
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[0]#, b1, b2
264
 
265
  with gr.Blocks(title = "Hello",
266
  css=".gradio-container {background:purple;}") as demo:
@@ -306,7 +306,7 @@ with gr.Blocks(title = "Hello",
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, 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])
 
241
  return b1, b2
242
 
243
  def upload_file(filepath):
244
+ #img = imread(filepath)
245
  #img = normalize99(img)
246
  #img = np.clip(img, 0, 1)
247
 
 
250
 
251
  #b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
252
  #b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
253
+ return filepath[0] #, b1, b2
254
 
255
 
256
  def update_image(filepath):
 
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:
 
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, 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])