Update my_model/utilities/state_manager.py
Browse files
my_model/utilities/state_manager.py
CHANGED
@@ -6,16 +6,20 @@ from my_model.KBVQA import KBVQA, prepare_kbvqa_model
|
|
6 |
|
7 |
|
8 |
class StateManager:
|
9 |
-
|
10 |
-
|
11 |
|
12 |
def initialize_state(self):
|
13 |
if 'images_data' not in st.session_state:
|
14 |
st.session_state['images_data'] = {}
|
15 |
if 'model_settings' not in st.session_state:
|
16 |
-
st.session_state['
|
|
|
|
|
17 |
if 'kbvqa' not in st.session_state:
|
18 |
st.session_state['kbvqa'] = None
|
|
|
|
|
19 |
|
20 |
|
21 |
def update_model_settings(self, detection_model=None, confidence_level=None, selected_method=None):
|
|
|
6 |
|
7 |
|
8 |
class StateManager:
|
9 |
+
def __init__(self):
|
10 |
+
self.initialize_state()
|
11 |
|
12 |
def initialize_state(self):
|
13 |
if 'images_data' not in st.session_state:
|
14 |
st.session_state['images_data'] = {}
|
15 |
if 'model_settings' not in st.session_state:
|
16 |
+
st.session_state['method'] = None
|
17 |
+
if 'detection_model': not in st.session_state
|
18 |
+
st.session_state['detection_model'] = None
|
19 |
if 'kbvqa' not in st.session_state:
|
20 |
st.session_state['kbvqa'] = None
|
21 |
+
if 'confidence_level': not in st.session_state
|
22 |
+
st.session_state['confidence_level'] = None
|
23 |
|
24 |
|
25 |
def update_model_settings(self, detection_model=None, confidence_level=None, selected_method=None):
|