Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -78,6 +78,7 @@ class InferenceRunner(StateManager):
|
|
78 |
self.process_new_image(uploaded_image.name, Image.open(uploaded_image), kbvqa)
|
79 |
|
80 |
# Display and interact with each uploaded/selected image
|
|
|
81 |
with self.col2:
|
82 |
for image_key, image_data in self.get_images_data().items():
|
83 |
with st.container():
|
@@ -88,7 +89,7 @@ class InferenceRunner(StateManager):
|
|
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):
|
91 |
-
|
92 |
caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'], kbvqa)
|
93 |
self.update_image_data(image_key, caption, detected_objects_str, True)
|
94 |
st.session_state['loading_in_progress'] = False
|
@@ -197,5 +198,5 @@ class InferenceRunner(StateManager):
|
|
197 |
free_gpu_resources()
|
198 |
st.session_state['loading_in_progress'] = False
|
199 |
self.image_qa_app(self.get_model())
|
200 |
-
|
201 |
|
|
|
78 |
self.process_new_image(uploaded_image.name, Image.open(uploaded_image), kbvqa)
|
79 |
|
80 |
# Display and interact with each uploaded/selected image
|
81 |
+
self.display_session_state()
|
82 |
with self.col2:
|
83 |
for image_key, image_data in self.get_images_data().items():
|
84 |
with st.container():
|
|
|
89 |
nested_col22.text("Please click 'Analyze Image'..")
|
90 |
with nested_col22:
|
91 |
if st.button('Analyze Image', key=f'analyze_{image_key}', on_click=self.disable_widgets, disabled=self.is_widget_disabled):
|
92 |
+
|
93 |
caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'], kbvqa)
|
94 |
self.update_image_data(image_key, caption, detected_objects_str, True)
|
95 |
st.session_state['loading_in_progress'] = False
|
|
|
198 |
free_gpu_resources()
|
199 |
st.session_state['loading_in_progress'] = False
|
200 |
self.image_qa_app(self.get_model())
|
201 |
+
|
202 |
|