jacopoteneggi commited on
Commit
5e91161
1 Parent(s): 2d9cd06
.pre-commit-config.yaml CHANGED
@@ -8,7 +8,3 @@ repos:
8
  rev: 22.6.0
9
  hooks:
10
  - id: black-jupyter
11
- - repo: https://github.com/kynan/nbstripout
12
- rev: 0.5.0
13
- hooks:
14
- - id: nbstripout
 
8
  rev: 22.6.0
9
  hooks:
10
  - id: black-jupyter
 
 
 
 
app_lib/main.py CHANGED
@@ -1,14 +1,14 @@
1
- import torch
2
  import streamlit as st
 
3
 
 
4
  from app_lib.user_input import (
 
5
  get_class_name,
6
  get_concepts,
7
  get_image,
8
  get_model_name,
9
- get_advanced_settings,
10
  )
11
- from app_lib.test import get_testing_config, test
12
  from app_lib.viz import viz_results
13
 
14
 
@@ -56,9 +56,13 @@ def main(device=torch.device("cuda" if torch.cuda.is_available() else "cpu")):
56
  st.error(error_message)
57
 
58
  with st.container():
59
- significance_level, tau_max, r, cardinality, dataset_name = get_advanced_settings(
60
- concepts, concepts_ready
61
- )
 
 
 
 
62
 
63
  test_button = st.button(
64
  "Test Concepts",
 
 
1
  import streamlit as st
2
+ import torch
3
 
4
+ from app_lib.test import get_testing_config, test
5
  from app_lib.user_input import (
6
+ get_advanced_settings,
7
  get_class_name,
8
  get_concepts,
9
  get_image,
10
  get_model_name,
 
11
  )
 
12
  from app_lib.viz import viz_results
13
 
14
 
 
56
  st.error(error_message)
57
 
58
  with st.container():
59
+ (
60
+ significance_level,
61
+ tau_max,
62
+ r,
63
+ cardinality,
64
+ dataset_name,
65
+ ) = get_advanced_settings(concepts, concepts_ready)
66
 
67
  test_button = st.button(
68
  "Test Concepts",
app_lib/test.py CHANGED
@@ -1,17 +1,17 @@
1
- import torch
2
- import clip
3
- import open_clip
4
- import h5py
5
- import streamlit as st
6
- import numpy as np
7
  from concurrent.futures import ThreadPoolExecutor, as_completed
8
 
 
 
9
  import ml_collections
 
 
 
 
10
  from huggingface_hub import hf_hub_download
11
 
12
- from ibydmt.test import xSKIT
13
- from app_lib.utils import SUPPORTED_MODELS
14
  from app_lib.ckde import cKDE
 
 
15
 
16
  rng = np.random.default_rng()
17
 
 
 
 
 
 
 
 
1
  from concurrent.futures import ThreadPoolExecutor, as_completed
2
 
3
+ import clip
4
+ import h5py
5
  import ml_collections
6
+ import numpy as np
7
+ import open_clip
8
+ import streamlit as st
9
+ import torch
10
  from huggingface_hub import hf_hub_download
11
 
 
 
12
  from app_lib.ckde import cKDE
13
+ from app_lib.utils import SUPPORTED_MODELS
14
+ from ibydmt.test import xSKIT
15
 
16
  rng = np.random.default_rng()
17
 
app_lib/user_input.py CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
2
  from PIL import Image
3
  from streamlit_image_select import image_select
4
 
5
- from app_lib.utils import SUPPORTED_MODELS, SUPPORTED_DATASETS
6
 
7
 
8
  def _validate_class_name(class_name):
 
2
  from PIL import Image
3
  from streamlit_image_select import image_select
4
 
5
+ from app_lib.utils import SUPPORTED_DATASETS, SUPPORTED_MODELS
6
 
7
 
8
  def _validate_class_name(class_name):
app_lib/viz.py CHANGED
@@ -1,6 +1,6 @@
1
- import streamlit as st
2
  import pandas as pd
3
  import plotly.express as px
 
4
 
5
 
6
  def _viz_wealth(results):
 
 
1
  import pandas as pd
2
  import plotly.express as px
3
+ import streamlit as st
4
 
5
 
6
  def _viz_wealth(results):