Romain Graux commited on
Commit
a691f55
1 Parent(s): 0ef4805

Auto build shared object if not already done

Browse files
Files changed (5) hide show
  1. .gitattributes +2 -0
  2. .gitignore +0 -1
  3. app.py +2 -5
  4. dataset/void.csv +1 -0
  5. utils/paths.py +10 -1
.gitattributes ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
2
+ models/model_C_NT_CLIP.ckpt filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -160,4 +160,3 @@ cython_debug/
160
  #.idea/
161
 
162
  data
163
- models
 
160
  #.idea/
161
 
162
  data
 
app.py CHANGED
@@ -3,7 +3,7 @@
3
  """
4
  @author : Romain Graux
5
  @date : 2023 April 25, 14:39:03
6
- @last modified : 2023 September 20, 15:35:23
7
  """
8
 
9
  # TODO : add the training of the vae
@@ -250,10 +250,7 @@ with gr.Blocks(css=CSS) as block:
250
  with gr.Row():
251
  n_species = gr.Number(
252
  label="Number of species",
253
- min=1,
254
- max=10,
255
  value=1,
256
- step=1,
257
  precision=0,
258
  visible=True,
259
  )
@@ -284,7 +281,7 @@ with gr.Blocks(css=CSS) as block:
284
  with gr.Tab("Masked prediction") as masked_tab:
285
  masked_prediction_gallery = gr.Gallery(
286
  label="Masked predictions"
287
- ).style(columns=3)
288
  with gr.Tab("Nearest neighbors") as nn_tab:
289
  bokeh_plot = gr.Plot(show_label=False)
290
  error_html = gr.HTML(visible=False)
 
3
  """
4
  @author : Romain Graux
5
  @date : 2023 April 25, 14:39:03
6
+ @last modified : 2024 February 01, 15:59:37
7
  """
8
 
9
  # TODO : add the training of the vae
 
250
  with gr.Row():
251
  n_species = gr.Number(
252
  label="Number of species",
 
 
253
  value=1,
 
254
  precision=0,
255
  visible=True,
256
  )
 
281
  with gr.Tab("Masked prediction") as masked_tab:
282
  masked_prediction_gallery = gr.Gallery(
283
  label="Masked predictions"
284
+ )
285
  with gr.Tab("Nearest neighbors") as nn_tab:
286
  bokeh_plot = gr.Plot(show_label=False)
287
  error_html = gr.HTML(visible=False)
dataset/void.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ Filename,Original,X,Y,Label,Split
utils/paths.py CHANGED
@@ -1,4 +1,6 @@
1
  import os
 
 
2
  from glob import glob
3
 
4
  PROJECT_PATH = os.path.abspath(os.path.join(__file__, *(os.path.pardir for _ in range(2))))
@@ -39,4 +41,11 @@ PRED_GT_VIS_PATH = os.path.join(DATA_VIS_PATH, 'predictions_gt')
39
  LANDS_VIS_PATH = os.path.join(DATA_VIS_PATH, 'landscapes')
40
  ACTIVATIONS_VIS_PATH = os.path.join(DATA_VIS_PATH, 'activations')
41
 
42
- LIB_PATH = glob(f"{os.path.join(PROJECT_PATH, 'build')}/lib*")[0]
 
 
 
 
 
 
 
 
1
  import os
2
+ import sys
3
+ import subprocess
4
  from glob import glob
5
 
6
  PROJECT_PATH = os.path.abspath(os.path.join(__file__, *(os.path.pardir for _ in range(2))))
 
41
  LANDS_VIS_PATH = os.path.join(DATA_VIS_PATH, 'landscapes')
42
  ACTIVATIONS_VIS_PATH = os.path.join(DATA_VIS_PATH, 'activations')
43
 
44
+ build_path = os.path.join(PROJECT_PATH, 'build')
45
+ lib_files = glob(f"{build_path}/lib*")
46
+
47
+ if not lib_files:
48
+ subprocess.check_call([sys.executable, 'setup.py', 'build_ext'], cwd=PROJECT_PATH)
49
+ lib_files = glob(f"{build_path}/lib*")
50
+
51
+ LIB_PATH = lib_files[0]