m7mdal7aj commited on
Commit
912debd
1 Parent(s): 8624b37

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +3 -3
my_model/tabs/run_inference.py CHANGED
@@ -84,7 +84,7 @@ class InferenceRunner(StateManager):
84
  nested_col21, nested_col22 = st.columns([0.65, 0.35])
85
  image_for_display = self.resize_image(image_data['image'], 600)
86
  nested_col21.image(image_for_display, caption=f'Uploaded Image: {image_key[-11:]}')
87
- if not image_data['analysis_done'] or self.settings_changed or st.session_state['confidence_level_changed']: # if not done analysis before or even done but settings changed, then we need to analyze again
88
  nested_col22.text("Please click 'Analyze Image'..")
89
  free_gpu_resources()
90
  with nested_col22:
@@ -100,7 +100,7 @@ class InferenceRunner(StateManager):
100
 
101
  if image_data['analysis_done']:
102
  free_gpu_resources()
103
- if st.session_state['confidence_level_changed']:
104
  nested_col22.warning("Confidence level changed, please click analyze again.")
105
  st.session_state['loading_in_progress'] = False
106
  sample_questions = config.SAMPLE_QUESTIONS.get(image_key, [])
@@ -148,7 +148,7 @@ class InferenceRunner(StateManager):
148
  force_reload_full_model = False
149
 
150
  #st.session_state['settings_changed'] = self.has_state_changed()
151
- if st.session_state['settings_changed']:
152
  self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")
153
 
154
  st.session_state.button_label = "Reload Model" if self.is_model_loaded and self.settings_changed else "Load Model"
 
84
  nested_col21, nested_col22 = st.columns([0.65, 0.35])
85
  image_for_display = self.resize_image(image_data['image'], 600)
86
  nested_col21.image(image_for_display, caption=f'Uploaded Image: {image_key[-11:]}')
87
+ if not image_data['analysis_done'] or self.settings_changed or self.confidance_change: # if not done analysis before or even done but settings changed, then we need to analyze again
88
  nested_col22.text("Please click 'Analyze Image'..")
89
  free_gpu_resources()
90
  with nested_col22:
 
100
 
101
  if image_data['analysis_done']:
102
  free_gpu_resources()
103
+ if self.confidance_change:
104
  nested_col22.warning("Confidence level changed, please click analyze again.")
105
  st.session_state['loading_in_progress'] = False
106
  sample_questions = config.SAMPLE_QUESTIONS.get(image_key, [])
 
148
  force_reload_full_model = False
149
 
150
  #st.session_state['settings_changed'] = self.has_state_changed()
151
+ if self.settings_changed:
152
  self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")
153
 
154
  st.session_state.button_label = "Reload Model" if self.is_model_loaded and self.settings_changed else "Load Model"