Continuously display webcam frame on streamlit.image takes time

When I try to display the streamlit with frame read from Opencv, it takes a lot of time. When running a while loop for reading frames from Webcam, I counted ~ 33 frames/ second, but when I put st.image(frame) into the while loop, I counted only 16 frames/second. Could you please help me understand the problem and how to bypass it?