vdprabhu commited on
Commit
dacd5b6
·
1 Parent(s): f7d1996

Update app_utils.py

Browse files
Files changed (1) hide show
  1. app_utils.py +20 -18
app_utils.py CHANGED
@@ -1,5 +1,24 @@
1
  import streamlit as st
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  # Strings
4
  replicate = ":bulb: Choose **ResNet50V2** model and **conv3_block4_out** to get the results as in the example."
5
  credits = ":memo: [Keras example](https://keras.io/examples/vision/visualizing_what_convnets_learn/) by [@fchollet](https://twitter.com/fchollet)."
@@ -18,21 +37,4 @@ IMG_WIDTH = 180
18
  IMG_HEIGHT = 180
19
  VIS_OPTION = {"only the first filter": 0, "the first 64 filters": 64}
20
  ITERATIONS = 30
21
- LEARNING_RATE = 10.0
22
-
23
-
24
- # Streamlit state variables
25
- if "model_name" not in st.session_state:
26
- st.session_state.model_name = None
27
-
28
- if "layer_name" not in st.session_state:
29
- st.session_state.layer_name = None
30
-
31
- if "layer_list" not in st.session_state:
32
- st.session_state.layer_list = None
33
-
34
- if "model" not in st.session_state:
35
- st.session_state.model = None
36
-
37
- if "feat_extract" not in st.session_state:
38
- st.session_state.feat_extract = None
 
1
  import streamlit as st
2
 
3
+ # Setting the states
4
+ def initialize_states():
5
+ # Streamlit state variables
6
+ if "model_name" not in st.session_state:
7
+ st.session_state.model_name = None
8
+
9
+ if "layer_name" not in st.session_state:
10
+ st.session_state.layer_name = None
11
+
12
+ if "layer_list" not in st.session_state:
13
+ st.session_state.layer_list = None
14
+
15
+ if "model" not in st.session_state:
16
+ st.session_state.model = None
17
+
18
+ if "feat_extract" not in st.session_state:
19
+ st.session_state.feat_extract = None
20
+
21
+
22
  # Strings
23
  replicate = ":bulb: Choose **ResNet50V2** model and **conv3_block4_out** to get the results as in the example."
24
  credits = ":memo: [Keras example](https://keras.io/examples/vision/visualizing_what_convnets_learn/) by [@fchollet](https://twitter.com/fchollet)."
 
37
  IMG_HEIGHT = 180
38
  VIS_OPTION = {"only the first filter": 0, "the first 64 filters": 64}
39
  ITERATIONS = 30
40
+ LEARNING_RATE = 10.0