Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -92,6 +92,7 @@ class InferenceRunner(StateManager):
|
|
92 |
if st.button('Analyze Image', key=f'analyze_{image_key}', on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
93 |
|
94 |
caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'])
|
|
|
95 |
self.update_image_data(image_key, caption, detected_objects_str, True)
|
96 |
st.session_state['loading_in_progress'] = False
|
97 |
free_gpu_resources()
|
@@ -122,7 +123,7 @@ class InferenceRunner(StateManager):
|
|
122 |
# if not question:
|
123 |
# nested_col22.warning("Please select or enter a question.")
|
124 |
# else:
|
125 |
-
if question in [q for q, _, _ in qa_history] and not self.settings_changed:
|
126 |
nested_col22.warning("This question has already been answered.")
|
127 |
else:
|
128 |
if nested_col22.button('Get Answer', key=f'answer_{image_key}', disabled=self.is_widget_disabled):
|
|
|
92 |
if st.button('Analyze Image', key=f'analyze_{image_key}', on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
93 |
|
94 |
caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'])
|
95 |
+
st.write(detected_objects_str)
|
96 |
self.update_image_data(image_key, caption, detected_objects_str, True)
|
97 |
st.session_state['loading_in_progress'] = False
|
98 |
free_gpu_resources()
|
|
|
123 |
# if not question:
|
124 |
# nested_col22.warning("Please select or enter a question.")
|
125 |
# else:
|
126 |
+
if question in [q for q, _, _ in qa_history] and not self.settings_changed and not self.confidance_change:
|
127 |
nested_col22.warning("This question has already been answered.")
|
128 |
else:
|
129 |
if nested_col22.button('Get Answer', key=f'answer_{image_key}', disabled=self.is_widget_disabled):
|