Repository navigation
Allow OpenCV 4.11 and NumPy 1.26 (GIF/AVIF still need OpenCV 4.12); bump to 0.4.1 - #16
Merged
Merged
Conversation
….4.1 Every opencv-python-headless 4.12+ wheel requires NumPy 2, so the 4.12 floor forced NumPy 2 on all users. Measured on Python 3.10 and 3.12 with NumPy 1.26.4, 2.0.2 and latest 2.x: 4.11.0.86 decodes JPEG, PNG, BMP and still and animated WebP and encodes JPEG/PNG, matching TorchCodec 0.17.0 as 4.12+ does; only GIF and AVIF are missing. 4.10.0.84 also cannot decode animated WebP, so 4.11 is the floor. The version check is now per codec: below 4.11 image codecs raise ImportError; GIF and AVIF raise RuntimeError naming OpenCV 4.12 and its NumPy 2 requirement. CI adds an OpenCV 4.11 + NumPy 1.26.4 job, and glibc 2.17 validation again installs NumPy 1.26.4 (with OpenCV 4.11 so pip keeps it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YAijSnAE4aAjuS1EcCTwqS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.4.0 requires
opencv-python-headless>=4.12, and every 4.12+ wheel requiresnumpy>=2, so it forces NumPy 2 on all users. This PR lowers the floors toopencv-python-headless>=4.11andnumpy>=1.26. GIF and AVIF now raise an explicit error on OpenCV < 4.12 instead of blocking every image codec. Version 0.4.1. Nothing is tagged or published.Measured (Linux x86_64, uv venvs, Python 3.10 and 3.12; NumPy 1.26.4, 2.0.2, latest 2.x)
Raw
cv2.imdecodemulti/cv2.imencode:<2.3)pytest --compare(TorchCodec 0.17.0) on 4.11, both NumPy 1.26.4 and 2.5.3, every JPEG/PNG/WebP/BMP test passes. The only failures are the 26 GIF/AVIF tests, and each fails with the new RuntimeError. On 5.0 all 154 pass.numpy==1.26.4resolves to OpenCV 4.11.0.86.Changes
pyproject.toml:numpy>=1.26,opencv-python-headless>=4.11, version 0.4.1 andtensorcodec-av==0.4.1. Version also bumped inav/Cargo.toml,av/Cargo.lockand__init__.py._opencv.py:opencv(codec)still raises ImportError below 4.11. GIF and AVIF raiseRuntimeError: GIF decoding requires OpenCV >= 4.12 (which requires NumPy >= 2), found 4.11.0. Nothing falls back silently.test-without-avjob with OpenCV 4.11.0.86 and NumPy 1.26.4 (macOS Intel, Python 3.10). The 4.12.0.88 job stays as the GIF/AVIF lower bound. The glibc 2.17 Python 3.10 validation installsnumpy==1.26.4 opencv-python-headless==4.11.0.86again; OpenCV is pinned so pip keeps NumPy 1.x.docs/images.md(install and requirements),docs/releasing.md(version, minimum NumPy line) and thedocs/system_ffmpeg.mdexample. README anddocs/package_size.mdnever stated a NumPy 2 or OpenCV 4.12 requirement, so they are unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01YAijSnAE4aAjuS1EcCTwqS