Skip to content

Require OpenCV 5.0, which the content model needs - #244

Merged
abrignoni merged 2 commits into
mainfrom
fix/opencv-5-floor
Sep 30, 2026
Merged

abrignoni merged 2 commits into
mainfrom
fix/opencv-5-floor

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Every OpenCV 4.x imports fine and cannot read the Find similar content model: 4.8 stops on its Expand node, 4.9 through 4.14 on its cubic Resize. Only 5.0 reads it. The floor stayed at 4.8 when the model shipped, so a source install with 4.x kept it and every content pass failed.

  • Requirements: opencv-python-headless>=5.0, and numpy>=2.0, which 5.0 requires.
  • macOS builds: conda-forge's py-opencv pinned to 5 or newer, since the requirements do not reach it.
  • A new test checks the model against ONNX Runtime, and --selfcheck now loads it.

A fresh venv holding 4.12 kept it under main's requirements, moved to 5.0 under these, and passed 819 tests.

🤖 Generated with Claude Code

abrignoni and others added 2 commits September 30, 2026 15:40
Every OpenCV 4.x imports fine and cannot read gleapp/models/dinov2_small.onnx:
4.8 stops on its Expand node and 4.9 through 4.14.0.94 on its cubic Resize. Only
5.0.0.93 reads it. The floor stayed at 4.8 when the model shipped, so a source
install that already had 4.x kept it and every content pass raised. The indexer
thread then ended, which is how test_a_source_added_while_the_indexer_works_is_indexed_too
failed on such an install: a 60 s wait for 6 indexed files that stopped at 3.

- requirements.txt and pyproject.toml ask for opencv-python-headless>=5.0 and
  numpy>=2.0, which 5.0 requires.
- The macOS builds take OpenCV from conda-forge, which the requirements do not
  reach, so both workflows and the README recipe pin py-opencv to 5 or newer.
- test_the_installed_opencv_reads_the_bundled_model loads the model and checks
  eight values of the stored vector against ONNX Runtime.
- --selfcheck loads the model, so a frozen build on 4.x fails its smoke test.
- The cross-platform rules record the measurements.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… numpy 2

Under numpy 2 pylint infers np.mgrid[...] as a tuple and reports no-member on
.astype, so the lint job failed in CI while a local run on numpy 1.26 passed.
np.meshgrid(..., indexing="ij") on float ranges gives a byte-identical grid on
numpy 1.26.4 and 2.2.6, so the recorded reference values still apply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni enabled auto-merge September 30, 2026 20:36
@abrignoni
abrignoni merged commit db18d03 into main Sep 30, 2026
12 checks passed
@abrignoni
abrignoni deleted the fix/opencv-5-floor branch October 1, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant