Commit Graph

23 Commits

Author SHA1 Message Date
Jirka Borovec 16814acff3
feat(utils): add `TkImageWindow` to unblock switch to `opencv-python-headless` (#2320)
- Added `sv.ImageWindow`, a Tkinter/Pillow-based desktop image viewer with BGR, grayscale, and BGRA support, keyboard polling, left-click callbacks, context-manager usage, window-state checks, and clean close handling
- Added responsive image resizing with optional aspect-ratio preservation and correctly mapped mouse coordinates after scaling or letterboxing
- Updated compatible runnable examples to use `sv.ImageWindow`, while retaining OpenCV display APIs for worker-thread streaming examples that are incompatible with Tkinter
- Improved `sv.cv2_to_pillow` to support grayscale and BGRA images
- Updated webcam guidance to clarify capture ownership and explicit `VideoCapture` cleanup
- Fixed image-window event handling to prevent stale keypresses, ghost windows, close-time races, and blocked waits after the window closes

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-15 15:06:55 +02:00
Jirka Borovec 0a95bae8a8
chore: bump minimum Python to 3.10 (#2260)
- Drop Python 3.9 from CI test matrix
- requires-python = ">=3.10" in pyproject.toml
- ruff target-version py39 → py310
- mypy python_version 3.9 → 3.10
- Remove Python 3.9 classifier

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-29 14:45:30 +02:00
Jirka Borovec 09b21992c5
chore: port example typing refinements (#2358)
Co-authored-by: Codex <codex@openai.com>
2026-06-27 09:08:54 +02:00
Jirka Borovec 66c49b2e80
examples/traffic_analysis: improve CLI argument handling (#2059)
* refactor(traffic_analysis): improve CLI argument handling
* fix(pre_commit): 🎨 auto format pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-02-03 12:56:56 +01:00
Onuralp SEZER 212e69b5a4
refactor: 🧪 type hints to use the new union syntax for optional types
- Updated type hints across multiple files to replace `Optional[X]` with `X | None` for better readability and consistency.
- Added `from __future__ import annotations` to files to enable postponed evaluation of type annotations.
- Adjusted function signatures and variable types in various modules including `polygon_zone.py`, `smoother.py`, `transformers.py`, `vlm.py`, and others.
- Ensured compatibility with Python 3.10+ type hinting features.

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2025-07-15 16:36:01 +03:00
Onuralp SEZER 00fab37e58
feat: 🚀 dropping python 3.8 support and upgrade all codes to python3.9 syntax style as min
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2025-07-14 20:12:11 +03:00
Onuralp SEZER 1f0c278c4e
refactor: ruff rules enabled and fixed and code refactor made
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-09-19 10:35:30 +03:00
LinasKo 28f83b18f9 Deprecate BoundingBoxAnnotator, rename to BoxAnnotator 2024-07-12 18:18:50 +03:00
pre-commit-ci[bot] d531c59f85 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-13 05:39:05 +00:00
Jeslin P James 15b1473c2f Updated examples to remove frame_resolution_wh from PolygonZone 2024-04-13 10:28:11 +05:30
Onuralp SEZER 56825423dc
fix: 🐞 update PolygonZone test and update traffic-analysis depricated codes are updated
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-02 03:25:59 +03:00
Kokouvi 226090aeaf
Update inference_example.py
formattig
2024-01-30 11:20:55 +00:00
Kokouvi 0603527bb2
Update inference_example.py
fix formatting
2024-01-30 11:12:54 +00:00
Kokouvi 82aa4bb857
Update inference_example.py
Formatting
2024-01-30 10:55:34 +00:00
pre-commit-ci[bot] 6c98e211e5 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-01-30 10:54:00 +00:00
Kokouvi 1e482e172f
Update inference_example.py
Adding else statement
2024-01-30 10:53:40 +00:00
bright1205 2d494893fc Refactor class DetectionsManager to handle empty detections_all array 2024-01-28 16:29:11 +00:00
SkalskiP b5f9cdf90e Merge remote-tracking branch 'origin/feature/from-roboflow-base-model' into feature/from-roboflow-base-model
# Conflicts:
#	examples/traffic_analysis/README.md
2024-01-04 14:58:30 +01:00
SkalskiP 0acd408f29 traffic analysis example cleanup 2024-01-04 14:56:56 +01:00
pre-commit-ci[bot] 26829070f3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-01-04 13:34:49 +00:00
SkalskiP 9c1f06046d traffic analysis example cleanup 2024-01-04 14:34:36 +01:00
pre-commit-ci[bot] 109ff2db6c fix(pre_commit): 🎨 auto format pre-commit hooks 2023-12-15 16:42:53 +00:00
Paul af5861557b Added examples using `inference` to each example directory and updated requirements and READMEs accordingly. 2023-12-15 09:38:05 -07:00