mouseland commited on
Commit
cb2e681
·
verified ·
1 Parent(s): c77528c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -233,9 +233,12 @@ def upload_file(filepath):
233
  img = normalize99(img)
234
  img = np.clip(img, 0, 1)
235
 
 
 
 
236
  b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
237
  b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
238
- return img, filepath, b1, b2
239
 
240
 
241
  def update_image(filepath):
@@ -257,7 +260,7 @@ with gr.Blocks(title = "Hello",
257
  gr.HTML("""<h4 style="color:white;">You may need to refresh/login for 5 minutes of free GPU compute/day. </h4>""")
258
  gr.HTML("""<h4 style="color:white;">"pip install cellpose" for full functionality. </h4>""")
259
 
260
- input_image = gr.Image(label = "Input image", type = "numpy")
261
 
262
  with gr.Row():
263
  with gr.Column(scale=1):
 
233
  img = normalize99(img)
234
  img = np.clip(img, 0, 1)
235
 
236
+ filegui = os.path.splitext(filepath)[0]+"_gui.png"
237
+ imsave(filegui, img)
238
+
239
  b1 = gr.DownloadButton("Download masks as TIFF", visible=False)
240
  b2 = gr.DownloadButton("Download outline image as PNG", visible=False)
241
+ return filegui, filepath, b1, b2
242
 
243
 
244
  def update_image(filepath):
 
260
  gr.HTML("""<h4 style="color:white;">You may need to refresh/login for 5 minutes of free GPU compute/day. </h4>""")
261
  gr.HTML("""<h4 style="color:white;">"pip install cellpose" for full functionality. </h4>""")
262
 
263
+ input_image = gr.Image(label = "Input image", type = "filepath")
264
 
265
  with gr.Row():
266
  with gr.Column(scale=1):