Image Processing (Edge Detection) Using Streamlit

I am using python code and streamlit for edge detection of images.

  1. I want to know how can I save or write processed or final images (i.e. edge detected images) with their original filenames (i.e. the image I uploaded using from st.file_uploader) in a specific folder?

  2. How can I export the dataframe to csv using st.function?