Repository navigation
fix(workflows): preserve image metadata on empty Template Matching results - #3038
Merged
PawelPeczek-Roboflow merged 4 commits intoSep 25, 2026
Conversation
davidnichols-ops
requested review from
PawelPeczek-Roboflow,
dkosowski87,
grzegorz-roboflow,
hansent,
probicheaux,
rafel-roboflow and
yeldarby
as code owners
September 21, 2026 16:31
davidnichols-ops
force-pushed
the
fix/template-empty-image-metadata
branch
from
September 24, 2026 02:36
81fce6c to
1e0f5f4
Compare
…sults When template_matching@v1 finds no matches, its numpy path returns a bare sv.Detections.empty(). The serializer then emits image.width and image.height as null, and the empty result has no parent/root lineage. Use the existing empty_detections_with_image_metadata(image) helper for this branch so zero-match results keep the input image's dimensions and lineage. Adds a block-level regression test and updates workflows CHANGELOG.
davidnichols-ops
force-pushed
the
fix/template-empty-image-metadata
branch
from
September 24, 2026 12:46
1e0f5f4 to
83ed04e
Compare
PawelPeczek-Roboflow
approved these changes
Sep 25, 2026
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.
Summary
When
template_matching@v1finds no matches, its numpy path returns a baresv.Detections.empty(). The serializer then emitsimage.widthandimage.heightasnull, and the empty result has no parent/root lineage. Use the existingempty_detections_with_image_metadata(image)helper for this branch so zero-match results keep the input image's dimensions and lineage. The matched-result path is unchanged; the tensor-native sibling already carries image metadata on empty results.Root cause and before/after
{"image": {"width": null, "height": null}, "predictions": []}.{"image": {"width": 160, "height": 120}, "predictions": []}and retains parent/root metadata on the empty detections object.What changed
Unreleasedchangelog entry.Verification
nulldimensions (1 failed, 4 passed).main,uv run --project . --extra test --locked pytest tests/unit_tests/core_steps/classical_cv/test_template_matching.py -qfromworkflows/: 5 passed, 8 Pydantic deprecation warnings.git diff --check: passed.Scope
This addresses the numpy Template Matching zero-match path. It does not change tensor-native behavior or claim that every downstream Workflows consumer has been exercised. Release timing is up to maintainers.