Collecting Webcam Data from user

You cannot use this method in streamlit, running in a hosted environment, because you are bypassing the browser. You have to use a streamlit component, for example streamlit-webrtc as already suggested by @Goyo