How to persist picture in streamlit page

Here’s what I want to do.
when I trained a model, I will list some pictures about performance like below

but when I press any button on the page, the pictures disappeared.

I have check some similar post in the forum, but can not find a right solution, SessionState can not fix this problem, if persist the state of run button to set it as True, then the model will run every time when I click any place on the page. so … It seems quite hard to solve this problem… can anyone give me any suggestions? thanks!!

Hey @kun,

I think the solution could be using SessionState but as you said you will have another problem regarding re-processing every time so the next thing that you could do is creating a function using @st.cache to prevent those reprocessing .