Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,7 +103,7 @@ def run_inference():
|
|
| 103 |
if model_changed or confidence_changed:
|
| 104 |
st.session_state['detection_model'] = detection_model
|
| 105 |
st.session_state['confidence_level'] = confidence_level
|
| 106 |
-
st.warning("Detection model or confidence level changed. Please reload the model
|
| 107 |
|
| 108 |
|
| 109 |
|
|
@@ -114,20 +114,7 @@ def run_inference():
|
|
| 114 |
st.session_state['kbvqa'] = None
|
| 115 |
|
| 116 |
# Button to load KBVQA models
|
| 117 |
-
|
| 118 |
-
if st.session_state['kbvqa'] is not None:
|
| 119 |
-
st.write("Model already loaded.")
|
| 120 |
-
else:
|
| 121 |
-
# Call the function to load models and show progress
|
| 122 |
-
st.text("Loading the model will take no more than a few minutes . .")
|
| 123 |
-
st.session_state['kbvqa'] = prepare_kbvqa_model(detection_model)
|
| 124 |
-
st.session_state['kbvqa'].detection_confidence = confidence_level
|
| 125 |
-
|
| 126 |
-
if st.session_state['kbvqa']:
|
| 127 |
-
st.write("Model is ready for inference.")
|
| 128 |
-
|
| 129 |
-
if st.session_state['kbvqa']:
|
| 130 |
-
image_qa_app(st.session_state['kbvqa'])
|
| 131 |
|
| 132 |
|
| 133 |
if st.button('Load Model'):
|
|
|
|
| 103 |
if model_changed or confidence_changed:
|
| 104 |
st.session_state['detection_model'] = detection_model
|
| 105 |
st.session_state['confidence_level'] = confidence_level
|
| 106 |
+
st.warning("Detection model or confidence level changed. Please reload the model, this will take few seconds :)")
|
| 107 |
|
| 108 |
|
| 109 |
|
|
|
|
| 114 |
st.session_state['kbvqa'] = None
|
| 115 |
|
| 116 |
# Button to load KBVQA models
|
| 117 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
|
| 120 |
if st.button('Load Model'):
|