m7mdal7aj commited on
Commit
824fe45
1 Parent(s): 96dd295

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +5 -3
my_model/tabs/run_inference.py CHANGED
@@ -54,9 +54,10 @@ class InferenceRunner(StateManager):
54
  nested_col21.image(image_for_display, caption=f'Uploaded Image: {image_key[-11:]}')
55
  if not image_data['analysis_done']:
56
  nested_col22.text("Please click 'Analyze Image'..")
57
- if nested_col22.button('Analyze Image', key=f'analyze_{image_key}'):
58
- caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'], kbvqa)
59
- self.update_image_data(image_key, caption, detected_objects_str, True)
 
60
 
61
  # Initialize qa_history for each image
62
  qa_history = image_data.get('qa_history', [])
@@ -78,6 +79,7 @@ class InferenceRunner(StateManager):
78
 
79
 
80
  def run_inference(self):
 
81
  self.set_up_widgets()
82
  load_fine_tuned_model = False
83
  fine_tuned_model_already_loaded = False
 
54
  nested_col21.image(image_for_display, caption=f'Uploaded Image: {image_key[-11:]}')
55
  if not image_data['analysis_done']:
56
  nested_col22.text("Please click 'Analyze Image'..")
57
+ with nested_col22:
58
+ if st.button('Analyze Image', key=f'analyze_{image_key}'):
59
+ caption, detected_objects_str, image_with_boxes = self.analyze_image(image_data['image'], kbvqa)
60
+ self.update_image_data(image_key, caption, detected_objects_str, True)
61
 
62
  # Initialize qa_history for each image
63
  qa_history = image_data.get('qa_history', [])
 
79
 
80
 
81
  def run_inference(self):
82
+
83
  self.set_up_widgets()
84
  load_fine_tuned_model = False
85
  fine_tuned_model_already_loaded = False