Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -103,8 +103,9 @@ class InferenceRunner(StateManager):
|
|
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 |
if nested_col22.button('Analyze Image', key=analyze_button_key, on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
106 |
-
|
107 |
-
|
|
|
108 |
st.session_state['loading_in_progress'] = False
|
109 |
|
110 |
def handle_question_answering(self, image_key: str, image_data: dict, nested_col22) -> None:
|
|
|
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 |
if nested_col22.button('Analyze Image', key=analyze_button_key, on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
106 |
+
with nested_col22.spinner('Analyzing the image...'):
|
107 |
+
caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'])
|
108 |
+
self.update_image_data(image_key, caption, detected_objects_str, True)
|
109 |
st.session_state['loading_in_progress'] = False
|
110 |
|
111 |
def handle_question_answering(self, image_key: str, image_data: dict, nested_col22) -> None:
|