Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -85,6 +85,7 @@ class InferenceRunner(StateManager):
|
|
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:
|
@@ -101,7 +102,9 @@ class InferenceRunner(StateManager):
|
|
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, [])
|
107 |
selected_question = nested_col22.selectbox(
|
@@ -150,6 +153,7 @@ class InferenceRunner(StateManager):
|
|
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"
|
155 |
|
|
|
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 |
+
|
89 |
nested_col22.text("Please click 'Analyze Image'..")
|
90 |
free_gpu_resources()
|
91 |
with nested_col22:
|
|
|
102 |
if image_data['analysis_done']:
|
103 |
free_gpu_resources()
|
104 |
if self.confidance_change:
|
105 |
+
|
106 |
nested_col22.warning("Confidence level changed, please click analyze again.")
|
107 |
+
self.update_prev_state()
|
108 |
st.session_state['loading_in_progress'] = False
|
109 |
sample_questions = config.SAMPLE_QUESTIONS.get(image_key, [])
|
110 |
selected_question = nested_col22.selectbox(
|
|
|
153 |
#st.session_state['settings_changed'] = self.has_state_changed()
|
154 |
if self.settings_changed:
|
155 |
self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")
|
156 |
+
self.update_prev_state()
|
157 |
|
158 |
st.session_state.button_label = "Reload Model" if self.is_model_loaded and self.settings_changed else "Load Model"
|
159 |
|