I wrote an app to display images from a 2D detector. I use the st.experimental_rerun() function to this continuously. When using longer exposure times (seconds) the image displayed from the previous run fades as do some of the other components (I added for setting up acquisition parameters).
Is there a way to avoid this, i.e. at least the image remains displayed with the original contrasts until being replaced by the new one?
Thanks a lot in advance and for the great streamlit!
what I did in my script was, that I separated calculation/data acquisition tasks, work(), from the stuff that does the displaying via streamlit, ui(). The script first runs ẁork() followed by ui(). What I observed, was that work() blocked part of streamlit activity which resulted in grayed-out widgets.
However, I now simply reversed the sequence, i.e. first ui() and than work(), which leads to better displaying performance. It might be necessary to do a st.experimental_rerun(), though, to update things in the UI.
Another solution is the use of asynchronous routines via asyncio as describe in this discussion:
I am still wondering, what’s the speediest way to display 2D/image data using streamlit.