-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Make OpenCV an optional dependency to support contrib variants #2139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
9518918
45c9402
4d9133b
b4b3422
b7aba15
63524a5
a59d3c2
e04444b
fa05b19
f88b612
2b67b3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,32 @@ You can install `supervision` in a | |
| [](../LICENSE.md) | ||
| [](https://badge.fury.io/py/supervision) | ||
|
|
||
| Supervision requires OpenCV. Choose the variant that best fits your needs: | ||
|
|
||
| ⚠️ **Important**: Only install one OpenCV variant at a time. The different `opencv-python` packages (standard, contrib, headless, etc.) are mutually exclusive and cannot coexist in the same environment. | ||
|
|
||
| ```bash | ||
| # Recommended for servers (no GUI) | ||
| pip install supervision[headless] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For desktop applications (includes GUI support) | ||
| pip install supervision[desktop] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For desktop with extra modules (e.g., CSRT tracker) | ||
| pip install supervision[desktop-contrib] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For servers with extra modules (no GUI) | ||
| pip install supervision[headless-contrib] | ||
| ``` | ||
|
|
||
| If you already have OpenCV installed: | ||
|
|
||
| ```bash | ||
| pip install supervision | ||
| ``` | ||
|
Comment on lines
+51
to
79
|
||
|
|
@@ -60,7 +86,23 @@ You can install `supervision` in a | |
| [](https://badge.fury.io/py/supervision) | ||
|
|
||
| ```bash | ||
| poetry add supervision | ||
| # With headless OpenCV (recommended for servers) | ||
| poetry add supervision[headless] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # With desktop OpenCV (includes GUI) | ||
| poetry add supervision[desktop] | ||
| ``` | ||
|
|
||
Borda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ```bash | ||
| # For desktop with extra modules (e.g., CSRT tracker) | ||
| poetry add supervision[desktop-contrib] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For servers with extra modules (no GUI) | ||
| poetry add supervision[headless-contrib] | ||
| ``` | ||
|
|
||
| === "uv" | ||
|
|
@@ -70,14 +112,36 @@ You can install `supervision` in a | |
| [](../LICENSE.md) | ||
| [](https://badge.fury.io/py/supervision) | ||
|
|
||
| ```bash | ||
| # With headless OpenCV (recommended for servers) | ||
| uv pip install supervision[headless] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For desktop applications (includes GUI support) | ||
| uv pip install supervision[desktop] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For desktop with extra modules (e.g., CSRT tracker) | ||
| uv pip install supervision[desktop-contrib] | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For servers with extra modules (no GUI) | ||
| uv pip install supervision[headless-contrib] | ||
| ``` | ||
|
|
||
| If you already have OpenCV installed: | ||
|
|
||
| ```bash | ||
| uv pip install supervision | ||
| ``` | ||
|
|
||
| For uv projects: | ||
|
|
||
| ```bash | ||
| uv add supervision | ||
| uv add supervision --extra headless | ||
| ``` | ||
|
Comment on lines
115
to
145
|
||
|
|
||
| === "rye" | ||
|
|
@@ -88,7 +152,23 @@ You can install `supervision` in a | |
| [](https://badge.fury.io/py/supervision) | ||
|
|
||
| ```bash | ||
| rye add supervision | ||
| # With headless OpenCV (recommended for servers) | ||
| rye add supervision --features headless | ||
| ``` | ||
|
Comment on lines
154
to
157
|
||
|
|
||
| ```bash | ||
| # For desktop applications (includes GUI support) | ||
| rye add supervision --features desktop | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For desktop with extra modules (e.g., CSRT tracker) | ||
| rye add supervision --features desktop-contrib | ||
| ``` | ||
|
|
||
| ```bash | ||
| # For servers with extra modules (no GUI) | ||
| rye add supervision --features headless-contrib | ||
| ``` | ||
|
|
||
| !!! example "conda/mamba install" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.