In order to use OpenCV in your Gradio or Python Spaces, you'll need to make the Space install both the Python and Debian dependencies
Using OpenCV in Spaces
In order to use OpenCV in your Gradio or Python Spaces, you'll need to make the Space install both the Python and Debian dependencies
This means adding python3-opencv to the packages.txt file, and adding opencv-python to the requirements.txt file. If those files don't exist, you'll need to create them.
To see an example, see this Gradio project.
Source and license
Source: Hub documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.