m7mdal7aj commited on
Commit
b84905e
1 Parent(s): f3a7724

Update my_model/utilities/state_manager.py

Browse files
Files changed (1) hide show
  1. my_model/utilities/state_manager.py +15 -7
my_model/utilities/state_manager.py CHANGED
@@ -22,15 +22,23 @@ class StateManager:
22
 
23
 
24
  def set_up_widgets(self):
25
- st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
26
- detection_model = st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
27
- default_confidence = 0.2 if st.session_state.detection_model == "yolov5" else 0.4
28
- self.set_slider_value(text="Select minimum detection confidence level", min_value=0.1, max_value=0.9, value=default_confidence, step=0.1, slider_key_name='confidence_level')
29
- show_model_settings = st.sidebar.checkbox("Show Model Settings", False)
 
 
 
 
 
 
30
 
31
  # Conditional display of model settings
32
- if show_model_settings:
33
- seld.display_model_settings()
 
 
34
 
35
 
36
  def set_slider_value(self, text, min_value, max_value, value, step, slider_key_name):
 
22
 
23
 
24
  def set_up_widgets(self):
25
+ # Create two columns with different widths
26
+ col1, col2 = st.columns([0.8, 0.2]) # Adjust the ratio as needed
27
+
28
+ # Use the second column (col2) for the checkbox
29
+
30
+
31
+ with col1:
32
+ st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
33
+ detection_model = st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
34
+ default_confidence = 0.2 if st.session_state.detection_model == "yolov5" else 0.4
35
+ self.set_slider_value(text="Select minimum detection confidence level", min_value=0.1, max_value=0.9, value=default_confidence, step=0.1, slider_key_name='confidence_level')
36
 
37
  # Conditional display of model settings
38
+ with col2:
39
+ show_model_settings = st.sidebar.checkbox("Show Model Settings", False)
40
+ if show_model_settings:
41
+ self.display_model_settings()
42
 
43
 
44
  def set_slider_value(self, text, min_value, max_value, value, step, slider_key_name):