Can anyone tell me how to fix this error?
Can you please share a code snippet and a link to your app’s GitHub repo so we can try to reproduce this error?
I re-configured the setup today to use environments file instead of requirements file. Unfortunately, still not working. And I believe I tried dlib-bin with each file.
This is the error I am getting now:
This is the environments file I am using:
@Franky1 Any advice?
Adding these additional packages fixed the issue:
build-essential cmake pkg-config
The app can now run - so I have a new issue - app requires webcam access → how can I allow that? Chrome only enables Webcam access if prompted and I do not get a request to allow, so there’s no way for me to update Chrome to allow for the Webcam access for the Streamlit URL I am using. Any ideas?
Their documentation (Use your camera & microphone - Computer - Google Chrome Help) has no info on how to allow without a prompt for a site.
The issue is I was using this video capture command to start the video feed which worked locally. However with Streamlit, this is running on the server and will not prompt the user to start the video capture, right? Any ideas on how to fix?
Can you share the application url ?
Hey, @Blake_Starnes thanks for posting.
The reason why it is working on your local but not on the server is simply because your server doesn’t have a webcam . And when you run the command
cv2.VideoCapture(), OpenCV looks for a webcam on the machine which is running the code. So when on local, your machine has a webcam but your server does not.
Solution for this:
Use the library streamlit-webrtc in your code.
you can also look for the tutorial from PyCon JP.
I hope your problem is solved now…
PS: I think this is your only option if you want to use a webcam for processing. But I have tried it myself and it will surely reduce your frame rates when running on the server because it takes time for every frame to upload from the user side to the server and then processing it and returning it again to the user.
That is why many live video processing tools run on apps rather than on browsers.
But it is always fun to use such kind of custom tools … I would recommend you to go for this.