Update my_model/utilities/state_manager.py
Browse files
my_model/utilities/state_manager.py
CHANGED
@@ -13,14 +13,25 @@ class StateManager:
|
|
13 |
if 'images_data' not in st.session_state:
|
14 |
st.session_state['images_data'] = {}
|
15 |
if 'method' not in st.session_state:
|
16 |
-
st.
|
17 |
if 'detection_model' not in st.session_state:
|
18 |
-
st.
|
19 |
if 'kbvqa' not in st.session_state:
|
20 |
st.session_state['kbvqa'] = None
|
|
|
|
|
21 |
if 'confidence_level' not in st.session_state:
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
|
|
|
|
24 |
|
25 |
|
26 |
|
|
|
13 |
if 'images_data' not in st.session_state:
|
14 |
st.session_state['images_data'] = {}
|
15 |
if 'method' not in st.session_state:
|
16 |
+
st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
|
17 |
if 'detection_model' not in st.session_state:
|
18 |
+
st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
|
19 |
if 'kbvqa' not in st.session_state:
|
20 |
st.session_state['kbvqa'] = None
|
21 |
+
|
22 |
+
self.default_confidence = 0.2 if detection_model == "yolov5" else 0.4
|
23 |
if 'confidence_level' not in st.session_state:
|
24 |
+
self.set_slider_value(text="Select minimum detection confidence level",
|
25 |
+
min_value=0.1,
|
26 |
+
max_value=0.9,
|
27 |
+
value=self.default_confidence,
|
28 |
+
step=0.1,
|
29 |
+
slider_key_name='confidence_level'
|
30 |
+
)
|
31 |
+
|
32 |
|
33 |
+
|
34 |
+
# confidence_level = st.slider("Select minimum detection confidence level", min_value=0.1, max_value=0.9, value=default_confidence, step=0.1)
|
35 |
|
36 |
|
37 |
|