m7mdal7aj commited on
Commit
d163e0e
1 Parent(s): 7d71f1b

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +5 -4
my_model/tabs/run_inference.py CHANGED
@@ -98,7 +98,7 @@ def run_inference():
98
  st.title("Run Inference")
99
 
100
 
101
- method = st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
102
  st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
103
  default_confidence = 0.2 if st.session_state['detection_model'] == "yolov5" else 0.4
104
  # confidence_level = st.slider("Select minimum detection confidence level", min_value=0.1, max_value=0.9, value=default_confidence, step=0.1)
@@ -107,16 +107,17 @@ def run_inference():
107
  max_value=0.9,
108
  value=default_confidence,
109
  step=0.1,
110
- slider_key_name='confidence_level',
111
  )
112
 
113
  # state_manager.update_model_settings(detection_model=detection_model, confidence_level=confidence_level, selected_method=method)
114
 
115
 
116
  # need_model_reload = state_manager.check_settings_changed(method, detection_model, confidence_level) and state_manager.is_model_loaded()
117
-
118
- button_label = "Reload Model" if st.session_state['kbvqa'] is not None else "Load Model"
119
  state_manager.display_session_state()
 
 
 
120
  if st.session_state.method == "Fine-Tuned Model":
121
  if st.button(button_label):
122
  if button_label == "Load Model" and state_manager.is_model_loaded():
 
98
  st.title("Run Inference")
99
 
100
 
101
+ st.selectbox("Choose a method:", ["Fine-Tuned Model", "In-Context Learning (n-shots)"], index=0, key='method')
102
  st.selectbox("Choose a model for objects detection:", ["yolov5", "detic"], index=1, key='detection_model')
103
  default_confidence = 0.2 if st.session_state['detection_model'] == "yolov5" else 0.4
104
  # confidence_level = st.slider("Select minimum detection confidence level", min_value=0.1, max_value=0.9, value=default_confidence, step=0.1)
 
107
  max_value=0.9,
108
  value=default_confidence,
109
  step=0.1,
110
+ slider_key_name='confidence_level'
111
  )
112
 
113
  # state_manager.update_model_settings(detection_model=detection_model, confidence_level=confidence_level, selected_method=method)
114
 
115
 
116
  # need_model_reload = state_manager.check_settings_changed(method, detection_model, confidence_level) and state_manager.is_model_loaded()
 
 
117
  state_manager.display_session_state()
118
+
119
+ button_label = "Reload Model" if st.session_state['kbvqa'] is not None else "Load Model"
120
+
121
  if st.session_state.method == "Fine-Tuned Model":
122
  if st.button(button_label):
123
  if button_label == "Load Model" and state_manager.is_model_loaded():