Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
@@ -87,6 +87,9 @@ class InferenceRunner(StateManager):
|
|
87 |
if image_data['analysis_done']:
|
88 |
self.display_question_answering_interface(image_key, image_data, nested_col22)
|
89 |
|
|
|
|
|
|
|
90 |
def display_question_answering_interface(self, image_key, image_data, nested_col22):
|
91 |
|
92 |
sample_questions = config.SAMPLE_QUESTIONS.get(image_key, [])
|
@@ -106,7 +109,7 @@ class InferenceRunner(StateManager):
|
|
106 |
if nested_col22.button('Get Answer', key=f'answer_{image_key}', disabled=self.is_widget_disabled):
|
107 |
answer, prompt_length = self.answer_question(image_data['caption'], image_data['detected_objects_str'], question)
|
108 |
self.add_to_qa_history(image_key, question, answer, prompt_length)
|
109 |
-
|
110 |
|
111 |
def image_qa_app(self):
|
112 |
self.display_sample_images()
|
|
|
87 |
if image_data['analysis_done']:
|
88 |
self.display_question_answering_interface(image_key, image_data, nested_col22)
|
89 |
|
90 |
+
if self.settings_changed or self.confidance_change:
|
91 |
+
nested_col22.warning("Confidence level changed, please click 'Analyze Image'.")
|
92 |
+
|
93 |
def display_question_answering_interface(self, image_key, image_data, nested_col22):
|
94 |
|
95 |
sample_questions = config.SAMPLE_QUESTIONS.get(image_key, [])
|
|
|
109 |
if nested_col22.button('Get Answer', key=f'answer_{image_key}', disabled=self.is_widget_disabled):
|
110 |
answer, prompt_length = self.answer_question(image_data['caption'], image_data['detected_objects_str'], question)
|
111 |
self.add_to_qa_history(image_key, question, answer, prompt_length)
|
112 |
+
# nested_col22.text(f"Q: {question}\nA: {answer}\nPrompt Length: {prompt_length}")
|
113 |
|
114 |
def image_qa_app(self):
|
115 |
self.display_sample_images()
|