m7mdal7aj commited on
Commit
b5bf11c
1 Parent(s): f993077

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +3 -2
my_model/tabs/run_inference.py CHANGED
@@ -35,7 +35,7 @@ class InferenceRunner(StateManager):
35
  for idx, sample_image_path in enumerate(self.sample_images):
36
  with cols[idx]:
37
  #image = Image.open(sample_image_path)
38
- image_for_display = self.resize_image_aspect_ratio(sample_image_path, 100)
39
  st.image(image_for_display)
40
  if st.button(f'Select Sample Image {idx + 1}', key=f'sample_{idx}'):
41
  self.process_new_image(sample_image_path, image, kbvqa)
@@ -47,7 +47,7 @@ class InferenceRunner(StateManager):
47
 
48
  # Display and interact with each uploaded/selected image
49
  for image_key, image_data in self.get_images_data().items():
50
- image_for_display = self.resize_image_aspect_ratio(image_for_display, 400)
51
  self.col2.image(image_for_display, caption=f'Uploaded Image: {image_key[-11:]}')
52
  if not image_data['analysis_done']:
53
  self.col2.text("Please click 'Analyze Image'..")
@@ -72,6 +72,7 @@ class InferenceRunner(StateManager):
72
 
73
  def run_inference(self):
74
  self.set_up_widgets()
 
75
  st.session_state['settings_changed'] = self.has_state_changed()
76
  if st.session_state['settings_changed']:
77
  self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")
 
35
  for idx, sample_image_path in enumerate(self.sample_images):
36
  with cols[idx]:
37
  #image = Image.open(sample_image_path)
38
+ image_for_display = self.resize_image(sample_image_path, 100, 100)
39
  st.image(image_for_display)
40
  if st.button(f'Select Sample Image {idx + 1}', key=f'sample_{idx}'):
41
  self.process_new_image(sample_image_path, image, kbvqa)
 
47
 
48
  # Display and interact with each uploaded/selected image
49
  for image_key, image_data in self.get_images_data().items():
50
+ image_for_display = self.resize_image(image_for_display, 500)
51
  self.col2.image(image_for_display, caption=f'Uploaded Image: {image_key[-11:]}')
52
  if not image_data['analysis_done']:
53
  self.col2.text("Please click 'Analyze Image'..")
 
72
 
73
  def run_inference(self):
74
  self.set_up_widgets()
75
+ self.image_qa_app(None)
76
  st.session_state['settings_changed'] = self.has_state_changed()
77
  if st.session_state['settings_changed']:
78
  self.col1.warning("Model settings have changed, please reload the model, this will take a second .. ")