Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -102,10 +102,11 @@ class InferenceRunner(StateManager):
|
|
102 |
if not image_data['analysis_done'] or self.settings_changed or self.confidance_change:
|
103 |
nested_col22.text("Please click 'Analyze Image'..")
|
104 |
analyze_button_key = f'analyze_{image_key}_{st.session_state.detection_model}_{st.session_state.confidence_level}'
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
109 |
st.session_state['loading_in_progress'] = False
|
110 |
|
111 |
def handle_question_answering(self, image_key: str, image_data: dict, nested_col22) -> None:
|
|
|
102 |
if not image_data['analysis_done'] or self.settings_changed or self.confidance_change:
|
103 |
nested_col22.text("Please click 'Analyze Image'..")
|
104 |
analyze_button_key = f'analyze_{image_key}_{st.session_state.detection_model}_{st.session_state.confidence_level}'
|
105 |
+
with nested_col22:
|
106 |
+
if st.button('Analyze Image', key=analyze_button_key, on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
107 |
+
with st.spinner('Analyzing the image...'):
|
108 |
+
caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'])
|
109 |
+
self.update_image_data(image_key, caption, detected_objects_str, True)
|
110 |
st.session_state['loading_in_progress'] = False
|
111 |
|
112 |
def handle_question_answering(self, image_key: str, image_data: dict, nested_col22) -> None:
|