supervision/examples
abritton2002 51dd062407
fix: VideoInfo.fps returns float instead of truncated int (#2210)
* VideoInfo.fps returns float instead of int

Truncating the raw CAP_PROP_FPS value with int() causes timing drift for
non-integer frame rates (23.976, 29.97, 59.94). Over a long video this
accumulates into noticeable sync errors — e.g. 23 vs 23.976 drifts ~1s
per minute of footage.

Changes:
- VideoInfo.fps type annotation: int -> float
- from_video_path: int(video.get(CAP_PROP_FPS)) -> float(...)
- ByteTrack.frame_rate type annotation: int -> float (already converts
  to int internally via max_time_lost = int(frame_rate / 30.0 * buffer))
- Tests: assert fps is float, add float_fps_video_path fixture at 23.976

* fix: update examples to cast float fps to int where required
* fix: wrap long docstring line in FPSBasedTimer (ruff E501)
* test: remove unused float_fps_video_path fixture

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-13 20:05:19 +02:00
..
compact_mask feat: add CompactMask for memory-efficient crop-RLE mask storage (#2159) 2026-04-13 11:10:12 +02:00
count_people_in_zone Standardize examples and error messages with `uv` CLI for virtual env. and dependency installation (#2129) 2026-02-03 13:59:35 +01:00
heatmap_and_track Standardize examples and error messages with `uv` CLI for virtual env. and dependency installation (#2129) 2026-02-03 13:59:35 +01:00
speed_estimation fix: VideoInfo.fps returns float instead of truncated int (#2210) 2026-04-13 20:05:19 +02:00
time_in_zone fix: VideoInfo.fps returns float instead of truncated int (#2210) 2026-04-13 20:05:19 +02:00
tracking Standardize examples and error messages with `uv` CLI for virtual env. and dependency installation (#2129) 2026-02-03 13:59:35 +01:00
traffic_analysis Standardize examples and error messages with `uv` CLI for virtual env. and dependency installation (#2129) 2026-02-03 13:59:35 +01:00
README.md Chore CI by adding checks for links and references (#2113) 2026-02-02 17:01:19 +01:00

README.md

Examples

Here, you'll find end-to-end examples that show how to solve common computer vision problems using Supervision.

For more information and examples, visit our documentation and explore our how-to guides and cookbooks. Join our Discord and meet other Supervision power users!