From d925cdf666347c03c823ac0b13f491dbb14e5a07 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:59:35 +0900 Subject: [PATCH] Standardize examples and error messages with `uv` CLI for virtual env. and dependency installation (#2129) --- examples/count_people_in_zone/README.md | 6 +++--- examples/heatmap_and_track/README.md | 6 +++--- examples/speed_estimation/README.md | 8 ++++---- examples/time_in_zone/README.md | 6 +++--- examples/tracking/README.md | 6 +++--- examples/traffic_analysis/README.md | 6 +++--- supervision/metrics/utils/utils.py | 5 ++--- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/examples/count_people_in_zone/README.md b/examples/count_people_in_zone/README.md index ab47b18f..1e488f5d 100644 --- a/examples/count_people_in_zone/README.md +++ b/examples/count_people_in_zone/README.md @@ -24,14 +24,14 @@ https://github.com/roboflow/supervision/assets/26109316/f84db7b5-79e2-4142-a1da- - setup python environment and activate it [optional] ```bash - python3 -m venv venv - source venv/bin/activate + uv venv + source .venv/bin/activate ``` - install required dependencies ```bash - pip install -r requirements.txt + uv pip install -r requirements.txt ``` - download `traffic_analysis.pt` and `traffic_analysis.mov` files diff --git a/examples/heatmap_and_track/README.md b/examples/heatmap_and_track/README.md index cf55f1f6..e454cdc1 100644 --- a/examples/heatmap_and_track/README.md +++ b/examples/heatmap_and_track/README.md @@ -18,14 +18,14 @@ supervision package for multiple tasks such as drawing heatmap annotations, trac - setup python environment and activate it [optional] ```bash - python3 -m venv venv - source venv/bin/activate + uv venv + source .venv/bin/activate ``` - install required dependencies ```bash - pip install -r requirements.txt + uv pip install -r requirements.txt ``` ## 🛠️ script arguments diff --git a/examples/speed_estimation/README.md b/examples/speed_estimation/README.md index eac4ef57..57409419 100644 --- a/examples/speed_estimation/README.md +++ b/examples/speed_estimation/README.md @@ -29,20 +29,20 @@ https://github.com/roboflow/supervision/assets/26109316/d50118c1-2ae4-458d-915a- - setup python environment and activate it [optional] ```bash - python3.10 -m venv venv - source venv/bin/activate + uv venv + source .venv/bin/activate ``` - install required dependencies ```bash - pip install -r requirements.txt + uv pip install -r requirements.txt ``` - download `vehicles.mp4` file ```bash - python3.10 video_downloader.py + python video_downloader.py ``` ## 🛠️ script arguments diff --git a/examples/time_in_zone/README.md b/examples/time_in_zone/README.md index a45d3f88..7beb05f3 100644 --- a/examples/time_in_zone/README.md +++ b/examples/time_in_zone/README.md @@ -23,14 +23,14 @@ https://github.com/roboflow/supervision/assets/26109316/d051cc8a-dd15-41d4-aa36- - setup python environment and activate it [optional] ```bash - python3 -m venv venv - source venv/bin/activate + uv venv + source .venv/bin/activate ``` - install required dependencies ```bash - pip install -r requirements.txt + uv pip install -r requirements.txt ``` ## 🛠 scripts diff --git a/examples/tracking/README.md b/examples/tracking/README.md index 3c5144b5..0e8b8788 100644 --- a/examples/tracking/README.md +++ b/examples/tracking/README.md @@ -17,14 +17,14 @@ detection and Supervision for tracking and annotation. - setup python environment and activate it [optional] ```bash - python3 -m venv venv - source venv/bin/activate + uv venv + source .venv/bin/activate ``` - install required dependencies ```bash - pip install -r requirements.txt + uv pip install -r requirements.txt ``` ## 🛠️ script arguments diff --git a/examples/traffic_analysis/README.md b/examples/traffic_analysis/README.md index 097a8cd0..7c9a5a32 100644 --- a/examples/traffic_analysis/README.md +++ b/examples/traffic_analysis/README.md @@ -20,14 +20,14 @@ https://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c- - setup python environment and activate it [optional] ```bash - python3 -m venv venv - source venv/bin/activate + uv venv + source .venv/bin/activate ``` - install required dependencies ```bash - pip install -r requirements.txt + uv pip install -r requirements.txt ``` - download `traffic_analysis.pt` and `traffic_analysis.mov` files diff --git a/supervision/metrics/utils/utils.py b/supervision/metrics/utils/utils.py index adb5ddf4..a108279e 100644 --- a/supervision/metrics/utils/utils.py +++ b/supervision/metrics/utils/utils.py @@ -4,7 +4,6 @@ def ensure_pandas_installed() -> None: except ImportError: raise ImportError( "`metrics` extra is required to run the function." - " Run `pip install 'supervision[metrics]'` or" - " `poetry add supervision -E metrics` or" - " `uv pip install 'supervision[metrics]'`" + " Run `uv pip install 'supervision[metrics]'` or" + " `uv add supervision --extra metrics`." )