Spaces:
Sleeping
Sleeping
Update my_model/tabs/run_inference.py
Browse files
my_model/tabs/run_inference.py
CHANGED
|
@@ -34,7 +34,6 @@ class InferenceRunner(StateManager):
|
|
| 34 |
# Display sample images as clickable thumbnails
|
| 35 |
self.col1.write("Choose from sample images:")
|
| 36 |
cols = self.col1.columns(len(self.sample_images))
|
| 37 |
-
st.write('loading in prog?', st.session_state['loading_in_progress'])
|
| 38 |
for idx, sample_image_path in enumerate(self.sample_images):
|
| 39 |
with cols[idx]:
|
| 40 |
image = Image.open(sample_image_path)
|
|
@@ -44,13 +43,11 @@ class InferenceRunner(StateManager):
|
|
| 44 |
self.process_new_image(sample_image_path, image, kbvqa)
|
| 45 |
|
| 46 |
|
| 47 |
-
st.write('loading in prog?',st.session_state['loading_in_progress'])
|
| 48 |
|
| 49 |
|
| 50 |
# Image uploader
|
| 51 |
uploaded_image = self.col1.file_uploader("Or upload an Image", type=["png", "jpg", "jpeg"])
|
| 52 |
|
| 53 |
-
st.write(st.session_state['loading_in_progress'])
|
| 54 |
|
| 55 |
if uploaded_image is not None:
|
| 56 |
self.process_new_image(uploaded_image.name, Image.open(uploaded_image), kbvqa)
|
|
@@ -186,5 +183,5 @@ class InferenceRunner(StateManager):
|
|
| 186 |
free_gpu_resources()
|
| 187 |
st.session_state['loading_in_progress'] = False
|
| 188 |
self.image_qa_app(self.get_model())
|
| 189 |
-
|
| 190 |
|
|
|
|
| 34 |
# Display sample images as clickable thumbnails
|
| 35 |
self.col1.write("Choose from sample images:")
|
| 36 |
cols = self.col1.columns(len(self.sample_images))
|
|
|
|
| 37 |
for idx, sample_image_path in enumerate(self.sample_images):
|
| 38 |
with cols[idx]:
|
| 39 |
image = Image.open(sample_image_path)
|
|
|
|
| 43 |
self.process_new_image(sample_image_path, image, kbvqa)
|
| 44 |
|
| 45 |
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
# Image uploader
|
| 49 |
uploaded_image = self.col1.file_uploader("Or upload an Image", type=["png", "jpg", "jpeg"])
|
| 50 |
|
|
|
|
| 51 |
|
| 52 |
if uploaded_image is not None:
|
| 53 |
self.process_new_image(uploaded_image.name, Image.open(uploaded_image), kbvqa)
|
|
|
|
| 183 |
free_gpu_resources()
|
| 184 |
st.session_state['loading_in_progress'] = False
|
| 185 |
self.image_qa_app(self.get_model())
|
| 186 |
+
|
| 187 |
|