imagescientist commited on
Commit
d90037c
·
1 Parent(s): fedbfb7

compensate for OS changes

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -4,6 +4,10 @@ import gradio as gr
4
 
5
  from PIL import Image, ImageEnhance
6
  import torchvision.transforms as T
 
 
 
 
7
 
8
  def name_to_hrs (r): return float(round(float(os.path.basename(r)[0:-4].split("_")[1][1:])*(minutes/60)+5,2))
9
  def validation_split (r): return os.path.basename(r)[0:-4].split("_")[3] == "R0003" or os.path.basename(r)[0:-4].split("_")[3] == "R0006"
@@ -28,4 +32,4 @@ def process_zebrafish_image(img):
28
  return dict(zip(T.ToPILImage(pred), map(float,age)))
29
 
30
  intf = gr.Interface(fn=process_zebrafish_image, inputs=gr.inputs.Image(shape=(512, 512)), outputs=[gr.outputs.Image(), gr.outputs.Label()]).launch(share=True)
31
- intf.launch(inline=False)
 
4
 
5
  from PIL import Image, ImageEnhance
6
  import torchvision.transforms as T
7
+ import pathlib
8
+ plt = platform.system()
9
+ print(str(plt))
10
+ if plt == 'linux': pathlib.WindowsPath = pathlib.PosixPath
11
 
12
  def name_to_hrs (r): return float(round(float(os.path.basename(r)[0:-4].split("_")[1][1:])*(minutes/60)+5,2))
13
  def validation_split (r): return os.path.basename(r)[0:-4].split("_")[3] == "R0003" or os.path.basename(r)[0:-4].split("_")[3] == "R0006"
 
32
  return dict(zip(T.ToPILImage(pred), map(float,age)))
33
 
34
  intf = gr.Interface(fn=process_zebrafish_image, inputs=gr.inputs.Image(shape=(512, 512)), outputs=[gr.outputs.Image(), gr.outputs.Label()]).launch(share=True)
35
+ intf.launch(inline=False)