I'm trying to install OpenCV on Heroku so my Python web app can use OpenCV. How can I go about doing this?
Thanks!
It is required since opencv has some additional dependencies that are not installed on heroku by default and needs to be installed manually. These dependencies can be installed by using linux commands sudo apt get install or sudo apt install.
Step 2: Activate your virtual environment and install the necessary modules. Step 3: Change the directory to mobilenetssd and create a file called app.py. In app.py, import the necessary modules. Step 4:Configure your static folder url, assign variables for the upload and download folders.
Install python 3.7 with anaconda package and use this command to install opencv.
Install OpenCV library with pip. After the installation of the Python and pip, we can directly install the OpenCV library and start using them. To install the library, we need to enter the given command in the terminal.
Its for the fellow googlers who might have been facing the same issue.
Just simply change opencv-python
in your requirements.txt to opencv-python-headless
.
opencv-python-headless is an opencv build that has no gpu support. The file libsm.so (P.S dont remember the name correctly) that is giving the error is for GPU support.
For reference :
opencv-python-headless
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With