Spaces:
Running
Running
Update my_model/tabs/run_inference.py
Browse files
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']:
|
88 |
nested_col22.text("Please click 'Analyze Image'..")
|
89 |
with nested_col22:
|
90 |
if st.button('Analyze Image', key=f'analyze_{image_key}', on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
@@ -114,7 +114,7 @@ class InferenceRunner(StateManager):
|
|
114 |
# if not question:
|
115 |
# nested_col22.warning("Please select or enter a question.")
|
116 |
# else:
|
117 |
-
if question in [q for q, _, _ in qa_history]:
|
118 |
nested_col22.warning("This question has already been answered.")
|
119 |
else:
|
120 |
if nested_col22.button('Get Answer', key=f'answer_{image_key}', disabled=self.is_widget_disabled):
|
@@ -141,7 +141,7 @@ class InferenceRunner(StateManager):
|
|
141 |
reload_detection_model = False
|
142 |
force_reload_full_model = False
|
143 |
|
144 |
-
st.session_state['settings_changed'] = self.has_state_changed()
|
145 |
if st.session_state['settings_changed']:
|
146 |
self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")
|
147 |
|
|
|
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: # 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 |
with nested_col22:
|
90 |
if st.button('Analyze Image', key=f'analyze_{image_key}', on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
|
|
114 |
# if not question:
|
115 |
# nested_col22.warning("Please select or enter a question.")
|
116 |
# else:
|
117 |
+
if question in [q for q, _, _ in qa_history] and not self.settings_changed:
|
118 |
nested_col22.warning("This question has already been answered.")
|
119 |
else:
|
120 |
if nested_col22.button('Get Answer', key=f'answer_{image_key}', disabled=self.is_widget_disabled):
|
|
|
141 |
reload_detection_model = False
|
142 |
force_reload_full_model = False
|
143 |
|
144 |
+
#st.session_state['settings_changed'] = self.has_state_changed()
|
145 |
if st.session_state['settings_changed']:
|
146 |
self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")
|
147 |
|