m7mdal7aj commited on
Commit
140c24a
1 Parent(s): 824d7ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -147,17 +147,17 @@ def run_inference():
147
 
148
  # Set default confidence based on the selected model
149
  default_confidence = 0.2 if detection_model == "yolov5" else 0.4
150
-
151
- # Slider for confidence level
152
- confidence_level = st.slider(
153
- "Select Detection Confidence Level",
154
- min_value=0.1,
155
- max_value=0.9,
156
- value=default_confidence,
157
- step=0.1
158
- )
159
-
160
- st.session_state['kbvqa'].detection_confidence = confidence_level
161
 
162
 
163
  # Main function
 
147
 
148
  # Set default confidence based on the selected model
149
  default_confidence = 0.2 if detection_model == "yolov5" else 0.4
150
+ if st.session_state['kbvqa']:
151
+ # Slider for confidence level
152
+ confidence_level = st.slider(
153
+ "Select Detection Confidence Level",
154
+ min_value=0.1,
155
+ max_value=0.9,
156
+ value=default_confidence,
157
+ step=0.1
158
+ )
159
+
160
+ st.session_state['kbvqa'].detection_confidence = confidence_level
161
 
162
 
163
  # Main function