m7mdal7aj commited on
Commit
80c9355
1 Parent(s): 7e54217

Update my_model/tabs/run_inference.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/run_inference.py +8 -0
my_model/tabs/run_inference.py CHANGED
@@ -42,8 +42,15 @@ class InferenceRunner(StateManager):
42
  if st.button(f'Select Sample Image {idx + 1}', key=f'sample_{idx}'):
43
  self.process_new_image(sample_image_path, image, kbvqa)
44
 
 
 
 
 
45
  # Image uploader
46
  uploaded_image = self.col1.file_uploader("Or upload an Image", type=["png", "jpg", "jpeg"])
 
 
 
47
  if uploaded_image is not None:
48
  self.process_new_image(uploaded_image.name, Image.open(uploaded_image), kbvqa)
49
 
@@ -156,6 +163,7 @@ class InferenceRunner(StateManager):
156
 
157
  if self.is_model_loaded():
158
  st.session_state['time_taken_to_load_model'] = time.time()-t1
 
159
  free_gpu_resources()
160
  st.session_state['loading_in_progress'] = False
161
  self.image_qa_app(self.get_model())
 
42
  if st.button(f'Select Sample Image {idx + 1}', key=f'sample_{idx}'):
43
  self.process_new_image(sample_image_path, image, kbvqa)
44
 
45
+
46
+ st.write(st.session_state['loading_in_progress'])
47
+
48
+
49
  # Image uploader
50
  uploaded_image = self.col1.file_uploader("Or upload an Image", type=["png", "jpg", "jpeg"])
51
+
52
+ st.write(st.session_state['loading_in_progress'])
53
+
54
  if uploaded_image is not None:
55
  self.process_new_image(uploaded_image.name, Image.open(uploaded_image), kbvqa)
56
 
 
163
 
164
  if self.is_model_loaded():
165
  st.session_state['time_taken_to_load_model'] = time.time()-t1
166
+ st.write(f'time is {time.time()-t1}')
167
  free_gpu_resources()
168
  st.session_state['loading_in_progress'] = False
169
  self.image_qa_app(self.get_model())