m7mdal7aj commited on
Commit
e4eee9a
1 Parent(s): 22d0357

Update my_model/utilities/state_manager.py

Browse files
my_model/utilities/state_manager.py CHANGED
@@ -14,8 +14,8 @@ class StateManager:
14
  st.session_state['images_data'] = {}
15
  if 'method' 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:
@@ -26,9 +26,9 @@ class StateManager:
26
  def set_up_widgets(self):
27
  st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
28
  detection_model = st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
29
- st.write("Detection Model")
30
- st.write(detection_model)
31
- default_confidence = 0.2 if detection_model == "yolov5" else 0.4
32
  self.set_slider_value(text="Select minimum detection confidence level",
33
  min_value=0.1,
34
  max_value=0.9,
@@ -36,7 +36,8 @@ class StateManager:
36
  step=0.1,
37
  slider_key_name='confidence_level'
38
  )
39
-
 
40
 
41
  def set_slider_value(self, text, min_value, max_value, value, step, slider_key_name):
42
 
 
14
  st.session_state['images_data'] = {}
15
  if 'method' 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:
 
26
  def set_up_widgets(self):
27
  st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
28
  detection_model = st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
29
+ st.write('detection model')
30
+ st.write(st.session_state.detection_model)
31
+ default_confidence = 0.2 if st.session_state.detection_model == "yolov5" else 0.4
32
  self.set_slider_value(text="Select minimum detection confidence level",
33
  min_value=0.1,
34
  max_value=0.9,
 
36
  step=0.1,
37
  slider_key_name='confidence_level'
38
  )
39
+ st.write("Detection Confidence")
40
+ st.write(st.session_state.confidence_level)
41
 
42
  def set_slider_value(self, text, min_value, max_value, value, step, slider_key_name):
43