Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -98,6 +98,7 @@ def process_new_image(image_key, image, kbvqa):
|
|
98 |
|
99 |
def run_inference():
|
100 |
st.title("Run Inference")
|
|
|
101 |
|
102 |
method = st.selectbox(
|
103 |
"Choose a method:",
|
@@ -106,7 +107,7 @@ def run_inference():
|
|
106 |
)
|
107 |
|
108 |
detection_model = st.selectbox(
|
109 |
-
"Choose a model for
|
110 |
["yolov5", "detic"],
|
111 |
index=1 # "detic" is selected by default
|
112 |
)
|
@@ -126,6 +127,9 @@ def run_inference():
|
|
126 |
settings_changed = (st.session_state['model_settings']['detection_model'] != detection_model or
|
127 |
st.session_state['model_settings']['confidence_level'] != confidence_level)
|
128 |
|
|
|
|
|
|
|
129 |
button_label = "Reload Model" if settings_changed else "Load Model"
|
130 |
|
131 |
if method == "Fine-Tuned Model":
|
@@ -202,7 +206,6 @@ def main():
|
|
202 |
|
203 |
|
204 |
elif selection == "Run Inference":
|
205 |
-
st.text("Please note that this is not a general purpose model, it is specifically trained on OK-VQA dataset and is designed to give short answers to the given questions.")
|
206 |
run_inference()
|
207 |
|
208 |
elif selection == "Code":
|
|
|
98 |
|
99 |
def run_inference():
|
100 |
st.title("Run Inference")
|
101 |
+
st.write("Please note that this is not a general purpose model, it is specifically trained on OK-VQA dataset and is designed to give short answers to the given questions.")
|
102 |
|
103 |
method = st.selectbox(
|
104 |
"Choose a method:",
|
|
|
107 |
)
|
108 |
|
109 |
detection_model = st.selectbox(
|
110 |
+
"Choose a model for objects detection:",
|
111 |
["yolov5", "detic"],
|
112 |
index=1 # "detic" is selected by default
|
113 |
)
|
|
|
127 |
settings_changed = (st.session_state['model_settings']['detection_model'] != detection_model or
|
128 |
st.session_state['model_settings']['confidence_level'] != confidence_level)
|
129 |
|
130 |
+
if settings_changed:
|
131 |
+
st.text("Model Settings have changed, please reload the model, this will take no time :)")
|
132 |
+
|
133 |
button_label = "Reload Model" if settings_changed else "Load Model"
|
134 |
|
135 |
if method == "Fine-Tuned Model":
|
|
|
206 |
|
207 |
|
208 |
elif selection == "Run Inference":
|
|
|
209 |
run_inference()
|
210 |
|
211 |
elif selection == "Code":
|