Unable to access camera through streamlit app

Can someone please help me out as to find what went wrong with my code?
This is the link to my app, git hub repository link

error message:

05:02:36] 🐍 Python dependencies were installed from /mount/src/emotion_based_music_recommendation_system/requirements.txt using uv.
[05:02:36] πŸ“¦ Processed dependencies!
  Stopping...



[05:02:40] πŸ”„ Updated app!
2024-11-05 05:02:46.077421: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-11-05 05:02:46.083272: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-11-05 05:02:46.095930: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:477] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1730782966.122040    1057 cuda_dnn.cc:8310] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1730782966.130183    1057 cuda_blas.cc:1418] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-11-05 05:02:46.160591: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
[ WARN:0@20.132] global cap_v4l.cpp:999 open VIDEOIO(V4L2:/dev/video0): can't open camera by index
[ERROR:0@20.132] global obsensor_uvc_stream_channel.cpp:158 getStreamChannelGroup Camera index out of range
[ WARN:1@1950.068] global cap_v4l.cpp:999 open VIDEOIO(V4L2:/dev/video0): can't open camera by index
[ERROR:1@1950.069] global obsensor_uvc_stream_channel.cpp:158 getStreamChannelGroup Camera index out of range

When you deploy a Streamlit so to Community Cloud, the Streamlit server (Python environment) is running on a remote machine. When you access the app, your browser/client is a different machine. When you use a Python library that accesses a camera, it’s looking for a camera attached to the remote machine. To use a camera with Streamlit (not running locally), you need a Streamlit-compatible package that will access the camera through the user’s browser.

1 Like