Hi all
I have sidebar slider. I want to call one function with the change in value of slider. How can i do that ?
confidence_threshold = st.sidebar.slider(“Confidence Threshold”, 0.35, 0.95, 0.35, 0.05,key=“confidence_slider”)
if st.button(‘Detect Arthropods’):
if my_upload is not None:
if my_upload.size > MAX_FILE_SIZE:
st.error("The uploaded file is too large. Please upload an image smaller than 5MB.")
else:
with st.spinner(text='In progress'):
process_image(image_file=my_upload,confidence_threshold=confidence_threshold)
with st.spinner(text='In progress'):
time.sleep(3)
st.success('Done')
bar = st.progress(50)
time.sleep(3)
bar.progress(100)
st.success('Success message')
else:
st.error('Please upload an image')
if confidence_threshold > 0.35 and confidence_threshold < 1.00:
if my_upload is not None:
if my_upload.size > MAX_FILE_SIZE:
st.error("The uploaded file is too large. Please upload an image smaller than 5MB.")
else:
with st.spinner(text='In progress'):
process_image(image_file=my_upload,confidence_threshold=confidence_threshold)
with st.spinner(text='In progress'):
time.sleep(3)
st.success('Done')
bar = st.progress(50)
time.sleep(3)
bar.progress(100)
st.success('Success message')
# else:
# st.write("In else")
# st.error('Please upload an image')
solved Thanks
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.